Hello Statalist,

I am working with dates and I am encountering a problem I have not encountered before. I have survey data, imported into Stata from an .xlsx file. See example below:

Code:
* Example generated by -dataex-. To install: ssc install dataex
clear
input double start
22604.393076203716
22604.414221446757
22604.437764884256
22604.459414791672
22604.472943287037
22604.490354120368
 22604.50474366898
 22604.51664253472
 22604.53772903935
22604.548425034718
22604.560529351853
22604.572168333332
22604.594228993054
 22604.60194003472
 22604.61860224537
22604.411773032407
22604.430122534726
 22604.44816359954
22604.459407881943
22604.470708449073
end
format %td start
If we check this variable we see it is stored as double and displayed as %td:
Code:
desc start
              storage   display    value
variable name   type    format     label      variable label
---------------------------------------------------------------------------
start           double  %td                   start
However, when we tabulate, it shows multiple values of the same date:
Code:
tab start

      start |      Freq.     Percent        Cum.
------------+-----------------------------------
  20nov2021 |          1        5.00        5.00
  20nov2021 |          1        5.00       10.00
  20nov2021 |          1        5.00       15.00
  20nov2021 |          1        5.00       20.00
  20nov2021 |          1        5.00       25.00
  20nov2021 |          1        5.00       30.00
  20nov2021 |          1        5.00       35.00
  20nov2021 |          1        5.00       40.00
  20nov2021 |          1        5.00       45.00
  20nov2021 |          1        5.00       50.00
  20nov2021 |          1        5.00       55.00
  20nov2021 |          1        5.00       60.00
  20nov2021 |          1        5.00       65.00
  20nov2021 |          1        5.00       70.00
  20nov2021 |          1        5.00       75.00
  20nov2021 |          1        5.00       80.00
  20nov2021 |          1        5.00       85.00
  20nov2021 |          1        5.00       90.00
  20nov2021 |          1        5.00       95.00
  20nov2021 |          1        5.00      100.00
------------+-----------------------------------
      Total |         20      100.00
If I change the format to %tc, it changes the displayed date to 1960:

Code:
format start %tc

desc start

              storage   display    value
variable name   type    format     label      variable label
---------------------------------------------------------------------------
start           double  %tc                   start

list start in 1/20

     +--------------------+
     |              start |
     |--------------------|
  1. | 01jan1960 00:00:22 |
  2. | 01jan1960 00:00:22 |
  3. | 01jan1960 00:00:22 |
  4. | 01jan1960 00:00:22 |
  5. | 01jan1960 00:00:22 |
     |--------------------|
  6. | 01jan1960 00:00:22 |
  7. | 01jan1960 00:00:22 |
  8. | 01jan1960 00:00:22 |
  9. | 01jan1960 00:00:22 |
 10. | 01jan1960 00:00:22 |
     |--------------------|
 11. | 01jan1960 00:00:22 |
 12. | 01jan1960 00:00:22 |
 13. | 01jan1960 00:00:22 |
 14. | 01jan1960 00:00:22 |
 15. | 01jan1960 00:00:22 |
     |--------------------|
 16. | 01jan1960 00:00:22 |
 17. | 01jan1960 00:00:22 |
 18. | 01jan1960 00:00:22 |
 19. | 01jan1960 00:00:22 |
 20. | 01jan1960 00:00:22 |
I would like to know how can I change the format and keep the correct date td(20nov2021).

Thanks in advance for your time.