mirror of
https://gitlab.com/MrFry/mrfrys-node-server
synced 2025-04-01 20:24:18 +02:00
Date string update, midnight timer update, other stuff
This commit is contained in:
parent
c764c4f402
commit
dbb23a6724
6 changed files with 92 additions and 61 deletions
|
@ -10,7 +10,8 @@ module.exports = {
|
|||
CreatePath: CreatePath,
|
||||
WatchFile: WatchFile,
|
||||
ReadDir: ReadDir,
|
||||
CopyFile: CopyFile
|
||||
CopyFile: CopyFile,
|
||||
GetDateString: GetDateString
|
||||
}
|
||||
|
||||
var fs = require('fs')
|
||||
|
@ -19,6 +20,16 @@ var logger = require('../utils/logger.js')
|
|||
|
||||
const dataFile = './public/data.json'
|
||||
|
||||
function GetDateString () {
|
||||
const m = new Date()
|
||||
return m.getFullYear() + '-' +
|
||||
('0' + (m.getMonth() + 1)).slice(-2) + '-' +
|
||||
('0' + m.getDate()).slice(-2) + ' ' +
|
||||
('0' + m.getHours()).slice(-2) + ':' +
|
||||
('0' + m.getMinutes()).slice(-2) + ':' +
|
||||
('0' + m.getSeconds()).slice(-2)
|
||||
}
|
||||
|
||||
function CopyFile (from, to) {
|
||||
CreatePath(to)
|
||||
fs.copyFileSync(from, to)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue