hello,
I would like to transform a series containing dates in numerical form (year*10000+month*100+day) into a date string. Also, is it possible to use this date string to then structure my workfile?
thanks a lot in advance
date conversion
Moderators: EViews Gareth, EViews Steve, EViews Moderator, EViews Jason
-
EViews Glenn
- EViews Developer
- Posts: 2682
- Joined: Wed Oct 15, 2008 9:17 am
Re: date conversion
From the docs
will create a date series that you can use to structure the workfile. You can use the @datestr function to create a string representation of the numbers in the date series, as in
where you substitute whatever valid format you would like in the last argument.
Among the built-in formats isThe @makedate function is used to translate ordinary numbers into date numbers. It is similar to @dateval but is designed for cases in which your dates are encoded in one or more numeric values instead of date strings:
...
@makedate(arg1[, arg2[,arg3]], fmt): takes the numeric values given by the arguments arg1, and optionally, arg2, etc. and returns a date number using the required format string, fmt.
...
So, if the coded dates are in the series A, then“yymmdd” or “yyyymmdd”: year*10000 + month*100 + day in month.
Code: Select all
series date = @makedate(a, "yyyymmdd")
Code: Select all
alpha datest = @datestr(date, "yyyy/mm/dd")
Who is online
Users browsing this forum: No registered users and 2 guests
