Wow. Only 11 years after REXX date conversions came to VM, I've
finally stumbled on a case where I need to convert dates to Julian
and back. Fortunately, on VM, there are conversions *from* Julian
and Century dates to the formats supported by the language definition.
What if I were on some platform without those conversions, though?
Is there some less cryptic way to go than converting via Basedays?
> JCDate: Procedure
> Parse Arg format, days, jc
> If format = '' then format = 'N'
> If jc = 'C' then
year = Left(Date('S'), 2) || '00'
> Else Do /* default to 'J' */
> Parse Var days year 3 days
> year = Left(Date('S'), 2) || year
> End
> /* Add the previous 31 December's Basedays */
> days = days + Date('B', year-1 || '1231', 'S')
> If Arg(4, 'E') then Return Date(format, days, 'B', Arg(4))
> Else Return Date(format, days, 'B')
�R
|
|
0
|
|
|
|
Reply
|
Glenn
|
4/8/2008 4:59:45 AM |
|
On Tue, 08 Apr 2008 00:59:45 -0400, Glenn Knickerbocker <NotR@bestweb.net>
wrote:
<47FAFBC1.C6EAFFBE@bestweb.net>
>Wow. Only 11 years after REXX date conversions came to VM, I've
>finally stumbled on a case where I need to convert dates to Julian
>and back. Fortunately, on VM, there are conversions *from* Julian
>and Century dates to the formats supported by the language definition.
>
>What if I were on some platform without those conversions, though?
>Is there some less cryptic way to go than converting via Basedays?
>
>> JCDate: Procedure
>> Parse Arg format, days, jc
>> If format = '' then format = 'N'
>> If jc = 'C' then
>year = Left(Date('S'), 2) || '00'
>> Else Do /* default to 'J' */
>> Parse Var days year 3 days
>> year = Left(Date('S'), 2) || year
>> End
>> /* Add the previous 31 December's Basedays */
>> days = days + Date('B', year-1 || '1231', 'S')
>> If Arg(4, 'E') then Return Date(format, days, 'B', Arg(4))
>> Else Return Date(format, days, 'B')
>
>�R
For platforms -without- adequate date conversion BUILTINs, basedays may be the
least cryptic route. It's what I would choose given those circumstances.
One of these days I'll get you to explain why you're "not R". That always
bothered me back at IBM.
(change Arabic number to Roman numeral to email)
|
|
0
|
|
|
|
Reply
|
Frank
|
4/9/2008 3:13:31 AM
|
|
Frank Clarke wrote:
> For platforms -without- adequate date conversion BUILTINs, basedays may be the
> least cryptic route.
I was slowly coming to that sad conclusion. I guess I'll stick that
routine away for future use!
> One of these days I'll get you to explain why you're "not R".
Or you could let http://users.bestweb.net/~notr/aol/whynot.r.html do it.
�R
|
|
0
|
|
|
|
Reply
|
Glenn
|
4/9/2008 6:38:43 PM
|
|
On Wed, 09 Apr 2008 14:38:43 -0400, Glenn Knickerbocker <NotR@bestweb.net>
wrote:
<47FD0D33.68C5EFBF@bestweb.net>
>Frank Clarke wrote:
>> For platforms -without- adequate date conversion BUILTINs, basedays may be the
>> least cryptic route.
>
>I was slowly coming to that sad conclusion. I guess I'll stick that
>routine away for future use!
>
>> One of these days I'll get you to explain why you're "not R".
>
>Or you could let http://users.bestweb.net/~notr/aol/whynot.r.html do it.
>
>�R
Hmmmm.... The one time I asked, your response was "It's long and complicated".
I see now the wisdom of that.
(change Arabic number to Roman numeral to email)
|
|
0
|
|
|
|
Reply
|
Frank
|
4/9/2008 9:20:45 PM
|
|
|
3 Replies
483 Views
(page loaded in 0.093 seconds)
Similiar Articles: Julian and Century date conversions - comp.lang.rexxWow. Only 11 years after REXX date conversions came to VM, I've finally stumbled on a case where I need to convert dates to Julian and back. Fortu... Julian Date to Normal Date - comp.soft-sys.matlabJulian and Century date conversions - comp.lang.rexx How compare two dates or convert date to number - comp.lang.perl ... Julian Date to Normal Date - comp.soft-sys.matlab ... Convert Bigint to DateTime - comp.databases.ibm-db2Julian and Century date conversions - comp.lang.rexx Convert Bigint to DateTime - comp.databases.ibm-db2... this question, you first need to tell us what signup_date is ... Converting milliseconds to Days, Hours, Minutes, Seconds - comp ...On converting modified julian date (MJD) to decimal year - comp ... Converting ... date to unix seconds from epoch - comp.soft-sys.matlab Hi, I want to convert a date ... How compare two dates or convert date to number - comp.lang.perl ...Julian and Century date conversions - comp.lang.rexx Only 11 years after REXX date conversions came to VM, I've finally stumbled on a case where I need to convert dates to ... Sort - Month then day without year - comp.databases.filemaker ...Julian and Century date conversions - comp.lang.rexx Sort - Month then day without year - comp.databases.filemaker ... Julian and Century date conversions - comp.lang.rexx ... find days between two dates span different years - comp.lang.ruby ...Julian and Century date conversions - comp.lang.rexx Only 11 years after REXX date conversions came to VM, I've ... 31 December's Basedays */ >> days = days + Date('B ... On converting modified julian date (MJD) to decimal year - comp ...Hi, I have data in MJD format that needs to be modified to decimal year format before I can work with it. I found the following link to convert fro... yyyymmdd to mm/dd/yyyy conversion - comp.soft-sys.matlab ...Hello, I need to convert a vector of dates from yyyymmdd to mm/dd/yyyy I got this to work for one date at a time, but i can't transform a whole vector... SAS - Convert YYYYMMDD to Julian7 format - comp.soft-sys.sas ...Convert the date value to a character string using the put function. On Fri, 23 Apr 2010 07:17:18 -0700 (PDT), Sath <sathiyamoorthi4u@gmail.com> wrote: >Hi ... Julian and Century date conversions - Application Forum at ...Julian and Century date conversions - REXX . This is a discussion on Julian and Century date conversions - REXX; Wow. Only 11 years after REXX date conversions came ... Julian and Century date conversions - comp.lang.rexx | Computer GroupWow. Only 11 years after REXX date conversions came to VM, I've finally stumbled on a case where I need to convert dates to Julian and back. Fortu... 7/23/2012 8:00:56 AM
|