Skip to content

Instantly share code, notes, and snippets.

@natergj
Created April 25, 2016 12:50
Show Gist options
  • Save natergj/eb026d5dfd75880841da885bd7467c2d to your computer and use it in GitHub Desktop.
Save natergj/eb026d5dfd75880841da885bd7467c2d to your computer and use it in GitHub Desktop.
// Uses excel4node version 1.x.x
var xl = require('excel4node');
var wb = new xl.Workbook({
dateFormat: 'm/d/yy hh:mm:ss'
});
var ws = wb.addWorksheet('Dates');
ws.cell(1, 1).date(new Date());
ws.cell(2, 1).date(new Date()).style({ numberFormat: 'yyyy-mm-dd' });
ws.column(1).setWidth(20);
wb.write('DateSample.xlsx');
@didzis85
Copy link

mm stands for minutes or months?

@akshatsingh1718
Copy link

mm stands for minutes or months?

mm for minutes with two digits eg:- 04, 10, 09 even if you have a single number it will represent a double-digit.
MM Stands for double-digit to represent the month.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment