How to write Date into an excel file in a specific format
See original GitHub issueI am trying to build an excel sheet which has date in a specific column. I am doing something like this:
sheet.getCell('A6').value(new Date());
when I generate the excel sheet, this gives me
4/9/2018
I would like it to display this instead:
4/9/2018 12:26:00 PM
Issue Analytics
- State:
- Created 5 years ago
- Comments:9 (2 by maintainers)
Top Results From Across the Web
Format a date the way you want - Microsoft Support
Select the cells you want to format. · Press CTRL+1. · In the Format Cells box, click the Number tab. · In the...
Read more >How to Change Date Format in Excel - Trifacta
Select the cells you want to format · Click Ctrl+1 or Command+1 · Select the “Numbers” tab · From the categories, choose “Date”...
Read more >Excel Date and Time Formatting - My Online Training Hub
On the Number tab select 'Date' in the Categories list. This brings up a list of default date formats you can select from...
Read more >Date format in Excel - Customize the display of your date
Usually, when you insert a date in a cell it is displayed in the format dd/mm/yyyy or mm/dd/yyyy. Let's say you have the...
Read more >Convert Date to Text in Excel - Explained with Examples
Example 2: Converting Current Date to Text ... To convert the current date into text, you can use the TODAY function along with...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@pmaiya - if you want to control how the date appears when loaded in Excel, then you need to use cell formatting:
@guyonroche - Should defining the numFmt like you did also work for column styles? I’m doing the following but still seems to show original date format (e.g. 8/1/18) instead of expected (e.g. 01/08/2018 for format below)