steamutils 1.5.9 → 1.5.10

Sign up to get free protection for your applications and to get access to all the features.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/utils.js +9 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "steamutils",
3
- "version": "1.5.09",
3
+ "version": "1.5.10",
4
4
  "main": "index.js",
5
5
  "dependencies": {
6
6
  "alpha-common-utils": "^1.0.6",
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
+ }