aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/util
diff options
context:
space:
mode:
Diffstat (limited to 'src/util')
-rw-r--r--src/util/timestamp.ts6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/util/timestamp.ts b/src/util/timestamp.ts
index 96c5064..01b78fb 100644
--- a/src/util/timestamp.ts
+++ b/src/util/timestamp.ts
@@ -39,10 +39,10 @@ export function encodeBase62(valu: number): string {
let res = "";
const mod = 62;
- while (valu > 0) {
+ do {
res = SHORT_CHARS[valu % mod] + res;
valu = Math.floor(valu / mod);
- }
+ } while (valu > 0);
return res;
}
@@ -55,7 +55,7 @@ export function getTimestamp(seconds: number): string {
const date = new Date(seconds * 1000);
const dateArr = [
date.getUTCFullYear(),
- date.getUTCMonth(),
+ date.getUTCMonth() + 1, // UTC month starts at 0
date.getUTCDate(),
date.getUTCHours(),
date.getUTCMinutes(),