Date in format yyyy-mm-dd
http://www.w3.org/TR/NOTE-datetime
:who
2 GB
:ED MD LOGIN
MD LOGIN
10 line(s)
----:
0001: PA
----: P
0001: PA
0002: TERM
0003: PTERM CASE NOINVERT
0004: DATE.FORMAT ON <=====
0005: OPTION QUERY.NO.CASE
0006: AUTOLOGOUT 120
0007: NLS CURRENCY R$
0008: NLS THOUSANDS .
0009: NLS DECIMAL ,
0010: NLS IMPLICIT.DECIMAL ,
Bottom at line 10
----: EX
:ED BP TEST
BP TEST
14 line(s)
----: P
0001: PRINT OCONV(DATE(),'D4/')
0002: PRINT OCONV(DATE(),'D YMD-')
0003: PRINT OCONV(DATE(),'D YMD') <====
0004: DATA$ = OCONV(DATE(),'D YMD') <====
0005: DATA$ = DATA$[1,4]:'-':DATA$[6,2]:'-':DATA$[9,2] <== *
0006: PRINT DATA$
0007: PRINT OCONV(DATE(),'DX-')
0008: PRINT OCONV(DATE(),'DX')
0009: EXECUTE 'DATE.FORMAT OFF'
0010: PRINT OCONV(DATE(),'D4/')
0011: EXECUTE 'DATE.FORMAT ON'
0012: PRINT OCONV(DATE(),'D4/')
0013: STOP
0014: END
Bottom at line 14
----:
:RUN BP TEST
09/05/2012
16201
2012 05 09 <==
2012-05-09 <== *
16201
20120509
05/09/2012
09/05/2012
* There is a simpler way, using only oconv?
Cleber
--
You received this message because you are subscribed to the Google Groups "OpenQM" group.
To post to this group, send an email to ope...@googlegroups.com.
To unsubscribe from this group, send email to openqm+un...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/openqm?hl=en-GB.
--
You received this message because you are subscribed to the Google Groups "OpenQM" group.
To post to this group, send an email to ope...@googlegroups.com.
To unsubscribe from this group, send email to openqm+un...@googlegroups.com.
Different standards may need different levels of granularity in the date and time, so this profile defines six levels. Standards that reference this profile should specify one or more of these granularities. If a given standard allows more than one granularity, it should specify the meaning of the dates and times with reduced precision, for example, the result of comparing two dates with different precisions.
The formats are as follows. Exactly the components shown here must be present, with exactly this punctuation. Note that the "T" appears literally in the string, to indicate the beginning of the time element, as specified in ISO 8601.
Year:
YYYY (eg 1997)
Year and month:
YYYY-MM (eg 1997-07)
Complete date:
YYYY-MM-DD (eg 1997-07-16)
Complete date plus hours and minutes:
YYYY-MM-DDThh:mmTZD (eg 1997-07-16T19:20+01:00)
Complete date plus hours, minutes and seconds:
YYYY-MM-DDThh:mm:ssTZD (eg 1997-07-16T19:20:30+01:00)
Complete date plus hours, minutes, seconds and a decimal fraction of a
second
YYYY-MM-DDThh:mm:ss.sTZD (eg 1997-07-16T19:20:30.45+01:00)"
Works correctly for me. What version of QM and platform is this on?
'D YMD' 1994 06 01
I will use:
04: DATA$ = OCONV(DATE(),'D YMD')
05: DATA$ = DATA$[1,4]:'-':DATA$[6,2]:'-':DATA$[9,2]
Thank you
Cleber
--
You received this message because you are subscribed to the Google Groups "OpenQM" group.
To post to this group, send an email to ope...@googlegroups.com.
To unsubscribe from this group, send email to openqm+un...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/openqm?hl=en-GB.
Okay Cleber, something weird is going on with your system I think.
:CT BP TESTDATE
BP TESTDATE
1: PRINT OCONV(DATE(),'D-YMD')
2: END
:RUN BP TESTDATE
2012-05-09
Ahhhhhh, I see the problem. You're using 'D YMD-' instead of 'D-YMD'
Cleber - on line 2, your dash is in the WRONG PLACE