mirror of
https://github.com/jmcnamara/libxlsxwriter.git
synced 2026-05-15 14:15:54 -06:00
[GH-ISSUE #200] Issue setting Date Number Format Cell #163
Labels
No labels
awaiting user feedback
bug
cmake
cmake
docs
feature request
in progress
long term
medium term
medium term
pull-request
question
question
ready to close
short term
under investigation
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: github-starred/libxlsxwriter#163
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @bettyleung on GitHub (Oct 8, 2018).
Original GitHub issue: https://github.com/jmcnamara/libxlsxwriter/issues/200
Originally assigned to: @jmcnamara on GitHub.
Hi,
I am using libxlsxwriter to format a date such as "mm-dd-yyyy"but the number format is set to "Custom" instead of "Short Date". I am using clang version 1000.11.45.2, OS = OSX and libxlsxwriter 0.8.3. Is there a way to create a cell entry in excel with the number format set to "Short Date"?'
Excel information about number format.
@jmcnamara commented on GitHub (Oct 8, 2018):
In order to get a "Short Date" you need to match the format used on your system. You can do that by setting the short date (or other format) for the cell and then switch to "Custom" to see what format Excel actually uses.
On one OS and Excel version that I have to hand it is
dd/mm/yyand on another it isdd/mm/yyyy.For the first case:
Which gives:
You can see the the asterisks next to the date indicates that it is a built-in style format.
Switching to Custom shows the format string used:
@jmcnamara commented on GitHub (Oct 8, 2018):
Another, more portable method across Excel versions and systems is to use one of the Excel's built in number formats using format_set_num_format_index():
@bettyleung commented on GitHub (Oct 9, 2018):
Thank you, it works.