Login or Register
Log in with
Forums
FAQ
Search in titles only
Search in General only
Advanced Search
Search
Home
Forums
Forums for Discussing Stata
General
You are not logged in. You can browse but not post. Login or
Register
by clicking 'Login or Register' at the top-right of this page. For more information on Statalist, see the
FAQ
.
Announcement
Collapse
No announcement yet.
X
Collapse
Posts
Latest Activity
Search
Page
of
1
Filter
Time
All Time
Today
Last Week
Last Month
Show
All
Discussions only
Photos only
Videos only
Links only
Polls only
Filtered by:
Clear All
new posts
LarsFolkestad
Join Date:
Sep 2014
Posts:
165
#1
From %tcnn/dd/ccYY_hh:MM to %td
01 Dec 2015, 05:10
Does anyone know how to get from a date (imported from excel)
2/18/2012 3:56 to a stata date called 18feb2012?
thank you
Lars
Rich Goldstein
Join Date:
Mar 2014
Posts:
4459
#2
01 Dec 2015, 05:34
under "help datetime", click on "sif-to-sif conversions" - the function you want is dofc (as shown in that part of the help file)
Comment
Post
Cancel
LarsFolkestad
Join Date:
Sep 2014
Posts:
165
#3
01 Dec 2015, 05:54
ended up doing:
Code:
gen new_date = dofc(date)
format new_date %td
Comment
Post
Cancel
Nick Cox
Join Date:
Mar 2014
Posts:
35671
#4
01 Dec 2015, 06:14
Note that "imported from Excel" means nothing here in itself. It covers everything from a string with that content to a formatted numeric date-time.
Comment
Post
Cancel
Previous
Next
Working...
Yes
No
OK
OK
Cancel
X
Comment