Downloading a sheet as a CSV converts the dates to MM/DD/YY
I'm downloading a sheet as a CSV, manipulating some data, and creating new spreadsheets out of that data.
Everything works until I try to upload a date that I'm downloading from smartsheets.
In the smartsheet the date looks like this:
However when I use the node SDK I get this:
var options = { id: spreadSheetID }; smartsheet.sheets.getSheetAsCSV(options).then(result => { console.log(result); } "Available_Date" "04/05/22" "04/12/22"
I know that I need to upload the dates in the YYYY-MM-DD format. So why does the API return them in the wrong format when exporting as a CSV?
Best Answer
-
Hi @charlie_wt
The format of the date that you're seeing in the sheet in Smartsheet is a display value specific to that sheet, however the underlying data will be based on your account's Personal Settings under Regional Preferences.
This is the date format that the API will pull when exporting a sheet for date columns, regardless of the sheet-specific display formatting. Exporting the sheet directly from the UI will provide the same experience: dates are exported in the format set in your Regional Preferences.
Cheers,
Genevieve
Need more help? 👀 | Help and Learning Center
こんにちは (Konnichiwa), Hallo, Hola, Bonjour, Olá, Ciao! 👋 | Global Discussions
Answers
-
Hi @charlie_wt
The format of the date that you're seeing in the sheet in Smartsheet is a display value specific to that sheet, however the underlying data will be based on your account's Personal Settings under Regional Preferences.
This is the date format that the API will pull when exporting a sheet for date columns, regardless of the sheet-specific display formatting. Exporting the sheet directly from the UI will provide the same experience: dates are exported in the format set in your Regional Preferences.
Cheers,
Genevieve
Need more help? 👀 | Help and Learning Center
こんにちは (Konnichiwa), Hallo, Hola, Bonjour, Olá, Ciao! 👋 | Global Discussions
-
This is very helpful, in the future though I think there should be an option to pass in the format of the dates so that they can be re-uploaded easier. It makes it hard to share scripts if you can't predict the date format either.
Categories
- All Categories
- 14 Welcome to the Community
- Smartsheet Customer Resources
- 64.2K Get Help
- 419 Global Discussions
- 221 Industry Talk
- 461 Announcements
- 4.8K Ideas & Feature Requests
- 143 Brandfolder
- 142 Just for fun
- 58 Community Job Board
- 462 Show & Tell
- 32 Member Spotlight
- 1 SmartStories
- 299 Events
- 38 Webinars
- 7.3K Forum Archives