Get date format for active page?
Moderators: EViews Gareth, EViews Moderator, EViews Jason, EViews Matt
Get date format for active page?
Is it possible to get the date format of the current page? So that I know that @dateval gives me the correct value.
-
EViews Gareth
- Fe ddaethom, fe welon, fe amcangyfrifon
- Posts: 13596
- Joined: Tue Sep 16, 2008 5:38 pm
Re: Get date format for active page?
format or frequency? @pagefreq give the frequency.
Format is machine based, not page/file based.
Format is machine based, not page/file based.
Re: Get date format for active page?
I was thinking date format. On a typical quarterly page, I'd like to get back "YYYY[Q]Q". I have often found code like this
which feels unstable and could be avoided if EViews supplied something like @pagedateformat to use instead of the unwieldy (and incomplete) expression for %old_date_format.
Code: Select all
%old_date_format = @word( _
"YYYY YYYY YYYY YYYY YYYY YYYY YYYY YYYY YYYY YYYY YYYY " _
+ "YYYY[S]S YYYY[Q]Q YYYY[M]MM " _
+ "DD/MM/YYYY DD/MM/YYYY DD/MM/YYYY DD/MM/YYYY DD/MM/YYYY DD/MM/YYYY", _
@wfindnc( _
"20Y 10Y 9Y 8Y 7Y 6Y 5Y 4Y 3Y 2Y A " _
+ "S Q M " _
+ "BM F T W D7 D5", _
@pagefreq _
) _
)
%new_date_format = "YYYY[M]MM"
%date_in_new_format = @datestr(@dateval(%date_in_old_format, %old_date_format), %new_date_format)Re: Get date format for active page?
By "machine based", do you mean that it depends on the locale of the machine?
Who is online
Users browsing this forum: No registered users and 1 guest
