Difference between revisions of "Date formats"

From VistApedia
Jump to: navigation, search
(Add HL7)
Line 14: Line 14:
 
*$H[OROLOG] contains a string value specifying the number of days since "31 December, 1840,"  
 
*$H[OROLOG] contains a string value specifying the number of days since "31 December, 1840,"  
 
*and the number of seconds since midnight of date in the time zone of the process, separated by a comma (,)
 
*and the number of seconds since midnight of date in the time zone of the process, separated by a comma (,)
==And Linux has a date command.==
+
==HL7 has a date definition [https://www.hl7.org/documentcenter/public_temp_690A2411-1C23-BA17-0C34058E1F0364CB/wg/inm/datatypes-its-xml20050714.htm#dtimpl-QTY]==
 +
"The value of a point in time is represented using the ISO 8601 compliant form traditionally in use with HL7. This is the form that has no decorating dashes, colons and no "T" between the date and time. In short, the syntax is "YYYYMMDDHHMMSS.UUUU[+|-ZZzz]" where digits can be omitted from the right side to express less precision. Common forms are "YYYYMMDD" and "YYYYMMDDHHMM", but the ability to truncate on the right side is not limited to these two variants. See the Data Types Abstract Specification for detail."
 +
==And Linux has a "date" command.==
 
<pre>
 
<pre>
GTM>W ! ZSYstem "date" Write "$Horolog="_$H,!,"DT=",DT 
+
TEST>W ! ZSYstem "date" Write "$Horolog="_$H_" where "_$P($H,",")_"/365.25 = "_(
 
+
$P($H,",")/365.25)_" years since 1841",!,"DT="_DT,!,"FM date/time="_$$NOW^XLFDT(
Wed Sep  9 14:29:32 EDT 2015
+
)_" where 315 is years since 1700",!,"HL7 date/time="_$$FMTHL7^XLFDT($$NOW^XLFDT
$Horolog=63804,52172
+
())
DT=3150909
 
  
 +
Fri Sep 11 14:53:12 EDT 2015
 +
$Horolog=63806,53592 where 63806/365.25 = 174.691307323750855 years since 1841
 +
DT=3150911
 +
FM date/time=3150911.145312 where 315 is years since 1700
 +
HL7 date/time=20150911145312-0500
 
</pre>
 
</pre>
  
 
--[[User:Ssw0213|Sherlocksfriend]] ([[User talk:Ssw0213|talk]]) 12:33, 9 September 2015 (MDT)
 
--[[User:Ssw0213|Sherlocksfriend]] ([[User talk:Ssw0213|talk]]) 12:33, 9 September 2015 (MDT)
 
[[Category:HOWTO]]
 
[[Category:HOWTO]]

Revision as of 18:55, 11 September 2015

In VistA, dates are usually in FileMan Date Format [1]

Quoting from Hardhats.org:
  • VA FileMan's conventional internal format: "YYYMMDD.HHMMSS":
  • YYY is number of years since 1700 (hence always 3 digits)
  • MM is month number (00-12)
  • DD is day number (00-31)
  • HH is hour number (00-23)
  • MM is minute number (01-59)
  • SS is the seconds number (01-59)
This format allows for representation of imprecise dates like JULY '78 or 1978 (which would be equivalent to 2780700 and 2780000, respectively).
Dates are always returned as a canonic number (no trailing zeroes after the decimal).
  • Today's date is usually available while VistA is running in the variable DT in FileMan format.

Mumps has the $Horolog intrinsic variable [2]

  • $H[OROLOG] contains a string value specifying the number of days since "31 December, 1840,"
  • and the number of seconds since midnight of date in the time zone of the process, separated by a comma (,)

HL7 has a date definition [3]

"The value of a point in time is represented using the ISO 8601 compliant form traditionally in use with HL7. This is the form that has no decorating dashes, colons and no "T" between the date and time. In short, the syntax is "YYYYMMDDHHMMSS.UUUU[+|-ZZzz]" where digits can be omitted from the right side to express less precision. Common forms are "YYYYMMDD" and "YYYYMMDDHHMM", but the ability to truncate on the right side is not limited to these two variants. See the Data Types Abstract Specification for detail."

And Linux has a "date" command.

TEST>W ! ZSYstem "date" Write "$Horolog="_$H_" where "_$P($H,",")_"/365.25 = "_(
$P($H,",")/365.25)_" years since 1841",!,"DT="_DT,!,"FM date/time="_$$NOW^XLFDT(
)_" where 315 is years since 1700",!,"HL7 date/time="_$$FMTHL7^XLFDT($$NOW^XLFDT
())

Fri Sep 11 14:53:12 EDT 2015
$Horolog=63806,53592 where 63806/365.25 = 174.691307323750855 years since 1841
DT=3150911
FM date/time=3150911.145312 where 315 is years since 1700
HL7 date/time=20150911145312-0500

--Sherlocksfriend (talk) 12:33, 9 September 2015 (MDT)