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.
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
+ }