steamutils 1.5.9 → 1.5.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/utils.js +9 -0
package/package.json
CHANGED
package/utils.js
CHANGED
@@ -1139,3 +1139,12 @@ export async function getImageSize(url) {
|
|
1139
1139
|
export function getGreetMessage() {
|
1140
1140
|
return _.sample(["nha", "nhá", "nhé"]);
|
1141
1141
|
}
|
1142
|
+
|
1143
|
+
export function logNow(...msg) {
|
1144
|
+
const date = new Date();
|
1145
|
+
const fmt = (n) => n.toString().padStart(2, "0");
|
1146
|
+
const offset = 7 * 60;
|
1147
|
+
const localDate = new Date(date.getTime() + offset * 60 * 1000);
|
1148
|
+
const formattedDate = `${fmt(localDate.getUTCDate())}/${fmt(localDate.getUTCMonth() + 1)}/${localDate.getUTCFullYear()} ${fmt(localDate.getUTCHours())}:${fmt(localDate.getUTCMinutes())}:${fmt(localDate.getUTCSeconds())}`;
|
1149
|
+
console.log(`[${formattedDate}]`, ...msg);
|
1150
|
+
}
|