How to use the date-utils.language function in date-utils

To help you get started, we’ve selected a few date-utils examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github iwfe / koa-rudy / middleware / log / index.js View on Github external
/*
 * @Author: enzo
 * @Date:   2016-11-30 11:08:34
 * @Last Modified by:   slashhuang
 * @Last Modified time: 2017-01-19 15:43:02
 * @modified content : 以stream形式修改日志处理方式
 */

const winston = require('winston');
const Path = require('path');
const env = process.env['NODE_ENV'];

const fs = require('fs');
const fse = require('fs-extra');
const dateUtils = require("date-utils").language("es");

//一小时更新下日志
const heartbeat = 120*60*1000;
// const heartbeat = 10*1000;
const timeReg = 'YYYY-MM-DD';

/*
 * 日志处理系统,在有日志的情况下只保留24个文件
 */
import  { LogQueue }  from './util';

const StreamPiper = require("fs-pipe");

/**
 * 错误处理
 */
github iwfe / koa-rudy / utils / common.js View on Github external
export function dateFormatReg(date, reg = 'YYYY-MM-DD HH24:MI:SS') {
    dateUtils.language("es");
    var dt = new Date(date);
    return dt.toFormat(reg);
}

date-utils

Date add-ons for Node.js

MIT
Latest version published 9 years ago

Package Health Score

56 / 100
Full package analysis