人生では、データとプレゼンテーションを区別することが大好きであるにもかかわらず、ロジックの一部をXSLTテンプレートに転送することが必要になる日が来るのです。
私の場合、地平線上で犯罪者は予見されませんでした。階層XMLログで2つのイベント間の時間を計算する必要がありました。 日付と時刻は、
RFC 3339と部分的に互換性のある形式で保存されていました。
この互換性は、日付
yyyy-MM-dd
および時刻
hh:mm:ss.SS
の正しい表記によって保証されましたが、標準から次の逸脱が発生しました。
- 日付と時刻は、文字
T
ではなくスペースで区切られます。 - ミリ秒を表す桁数は、「niode」から「many、many」までさまざまです。
- タイムゾーンはまったく示されていません。
最初はexslt.orgで既製のソリューションを使用したかった-date
date:difference
、それを放棄しなければなりませんでした。 実際、ミリ秒の精度で差を取得する必要があり、このアルゴリズムは有効な
xsd:duration
(ISO 8601)を返しました。これにはミリ秒は含まれていません。 さらに、他の人の出力を解析することは、正式ではありますが、あまり感謝されていません。 したがって、exsltを少し掘り下げて、私がパーサーを自分で書くことにしました。
exsltと同じ名前空間を持つテンプレートを拡張して収集することが決定されたため、コンテナタイプ
< xsl:stylesheet/ >
適切です。
<? xml version ="1.0" encoding ="utf-8" ? > < xsl:stylesheet version ="1.0" xmlns:date ="date" xmlns:xsl ="http://www.w3.org/1999/XSL/Transform" extension-element-prefixes ="date"> <!-- Source code goes here --> </ xsl:stylesheet >
<? xml version ="1.0" encoding ="utf-8" ? > < xsl:stylesheet version ="1.0" xmlns:date ="date" xmlns:xsl ="http://www.w3.org/1999/XSL/Transform" extension-element-prefixes ="date"> <!-- Source code goes here --> </ xsl:stylesheet >
<? xml version ="1.0" encoding ="utf-8" ? > < xsl:stylesheet version ="1.0" xmlns:date ="date" xmlns:xsl ="http://www.w3.org/1999/XSL/Transform" extension-element-prefixes ="date"> <!-- Source code goes here --> </ xsl:stylesheet >
<? xml version ="1.0" encoding ="utf-8" ? > < xsl:stylesheet version ="1.0" xmlns:date ="date" xmlns:xsl ="http://www.w3.org/1999/XSL/Transform" extension-element-prefixes ="date"> <!-- Source code goes here --> </ xsl:stylesheet >
<? xml version ="1.0" encoding ="utf-8" ? > < xsl:stylesheet version ="1.0" xmlns:date ="date" xmlns:xsl ="http://www.w3.org/1999/XSL/Transform" extension-element-prefixes ="date"> <!-- Source code goes here --> </ xsl:stylesheet >
<? xml version ="1.0" encoding ="utf-8" ? > < xsl:stylesheet version ="1.0" xmlns:date ="date" xmlns:xsl ="http://www.w3.org/1999/XSL/Transform" extension-element-prefixes ="date"> <!-- Source code goes here --> </ xsl:stylesheet >
<? xml version ="1.0" encoding ="utf-8" ? > < xsl:stylesheet version ="1.0" xmlns:date ="date" xmlns:xsl ="http://www.w3.org/1999/XSL/Transform" extension-element-prefixes ="date"> <!-- Source code goes here --> </ xsl:stylesheet >
extension-element-prefixes
宣言された拡張ネームスペースはテンプレートで使用され、XMLネームスペース
date:*
は次のコンテナを宣言するために1回だけ使用されます。
< date:month > < january > 31 </ january > < february > 28 </ february > < march > 31 </ march > < april > 30 </ april > < may > 31 </ may > < june > 30 </ june > < july > 31 </ july > < august > 31 </ august > < september > 30 </ september > < october > 31 </ october > < november > 30 </ november > < december > 31 </ december > </ date:month >
< date:month > < january > 31 </ january > < february > 28 </ february > < march > 31 </ march > < april > 30 </ april > < may > 31 </ may > < june > 30 </ june > < july > 31 </ july > < august > 31 </ august > < september > 30 </ september > < october > 31 </ october > < november > 30 </ november > < december > 31 </ december > </ date:month >
< date:month > < january > 31 </ january > < february > 28 </ february > < march > 31 </ march > < april > 30 </ april > < may > 31 </ may > < june > 30 </ june > < july > 31 </ july > < august > 31 </ august > < september > 30 </ september > < october > 31 </ october > < november > 30 </ november > < december > 31 </ december > </ date:month >
< date:month > < january > 31 </ january > < february > 28 </ february > < march > 31 </ march > < april > 30 </ april > < may > 31 </ may > < june > 30 </ june > < july > 31 </ july > < august > 31 </ august > < september > 30 </ september > < october > 31 </ october > < november > 30 </ november > < december > 31 </ december > </ date:month >
< date:month > < january > 31 </ january > < february > 28 </ february > < march > 31 </ march > < april > 30 </ april > < may > 31 </ may > < june > 30 </ june > < july > 31 </ july > < august > 31 </ august > < september > 30 </ september > < october > 31 </ october > < november > 30 </ november > < december > 31 </ december > </ date:month >
< date:month > < january > 31 </ january > < february > 28 </ february > < march > 31 </ march > < april > 30 </ april > < may > 31 </ may > < june > 30 </ june > < july > 31 </ july > < august > 31 </ august > < september > 30 </ september > < october > 31 </ october > < november > 30 </ november > < december > 31 </ december > </ date:month >
< date:month > < january > 31 </ january > < february > 28 </ february > < march > 31 </ march > < april > 30 </ april > < may > 31 </ may > < june > 30 </ june > < july > 31 </ july > < august > 31 </ august > < september > 30 </ september > < october > 31 </ october > < november > 30 </ november > < december > 31 </ december > </ date:month >
< date:month > < january > 31 </ january > < february > 28 </ february > < march > 31 </ march > < april > 30 </ april > < may > 31 </ may > < june > 30 </ june > < july > 31 </ july > < august > 31 </ august > < september > 30 </ september > < october > 31 </ october > < november > 30 </ november > < december > 31 </ december > </ date:month >
< date:month > < january > 31 </ january > < february > 28 </ february > < march > 31 </ march > < april > 30 </ april > < may > 31 </ may > < june > 30 </ june > < july > 31 </ july > < august > 31 </ august > < september > 30 </ september > < october > 31 </ october > < november > 30 </ november > < december > 31 </ december > </ date:month >
< date:month > < january > 31 </ january > < february > 28 </ february > < march > 31 </ march > < april > 30 </ april > < may > 31 </ may > < june > 30 </ june > < july > 31 </ july > < august > 31 </ august > < september > 30 </ september > < october > 31 </ october > < november > 30 </ november > < december > 31 </ december > </ date:month >
< date:month > < january > 31 </ january > < february > 28 </ february > < march > 31 </ march > < april > 30 </ april > < may > 31 </ may > < june > 30 </ june > < july > 31 </ july > < august > 31 </ august > < september > 30 </ september > < october > 31 </ october > < november > 30 </ november > < december > 31 </ december > </ date:month >
< date:month > < january > 31 </ january > < february > 28 </ february > < march > 31 </ march > < april > 30 </ april > < may > 31 </ may > < june > 30 </ june > < july > 31 </ july > < august > 31 </ august > < september > 30 </ september > < october > 31 </ october > < november > 30 </ november > < december > 31 </ december > </ date:month >
< date:month > < january > 31 </ january > < february > 28 </ february > < march > 31 </ march > < april > 30 </ april > < may > 31 </ may > < june > 30 </ june > < july > 31 </ july > < august > 31 </ august > < september > 30 </ september > < october > 31 </ october > < november > 30 </ november > < december > 31 </ december > </ date:month >
< date:month > < january > 31 </ january > < february > 28 </ february > < march > 31 </ march > < april > 30 </ april > < may > 31 </ may > < june > 30 </ june > < july > 31 </ july > < august > 31 </ august > < september > 30 </ september > < october > 31 </ october > < november > 30 </ november > < december > 31 </ december > </ date:month >
番号または月名で日数を取得するために、変数を導入します:
< xsl:variable name ="date:month"
select ="document('')//date:month"/>
sum($date:month/*[$i>=position()])+($i>2)
-先月の
$i
うるう年の総日数のようなXPathを書くことができます。
日付/時刻文字列を解析するプロセスでは、
NaN
との一致を数値で確認する必要があり、正の比較の場合は
0
に置き換えます。 これにより多くの
< xsl:if />
が生成され、コードが乱雑になります。 だから私はこのような
translate
を使い始めました:
translate($expression,'NaN',0)
しかし、そのようなコードもきちんと表示されません。 いくつかの審議の後、自動フォーマットの小数でオプションが選択されました。
< xsl:decimal-format NaN ="0"/>
興味深いことに、Opera 10.53では、
format-number
関数は3つの引数を処理できず、不明なエラーを生成します。これにより、次のような名前付き
decimal-format
数値形式を使用できなくなります。
< xsl:decimal-format name ="date:NaN" NaN ="0">
< xsl:decimal-format name ="date:NaN" NaN ="0">
つまり テンプレートをドロップするXPathは次のとおり
format-number($expression,0,'date:NaN')
:
format-number($expression,0,'date:NaN')
日時からタイムスタンプ
次のリストは、日時をミリ秒のタイムスタンプに変換するためのテンプレートです。
< xsl:template name ="date:timestamp" > < xsl:param name ="date-time" /> < xsl:variable name ="compact" select =" normalize-space( translate($date-time,'TZ ',''))" /> < xsl:variable name ="year" select =" translate( substring($compact,1, 4+(starts-with($compact,'+') or starts-with($compact,'-'))), '+','')"/> < xsl:variable name ="date" select ="substring-after($compact,$year)" /> < xsl:variable name ="time" select ="substring($date,7)" /> < xsl:variable name ="month" select ="format-number(substring($date,2,2)-1,0)" /> < xsl:variable name ="utc-offset" > < xsl:variable name ="raw" select =" concat( substring-after($time,'+'), substring-after($time,'-'))"/> < xsl:variable select =" format-number( (contains($time,'-')-.5) *2*(substring($raw,1,2)*60 +substring($raw,4,2)),0)"/> </ xsl:variable > < xsl:variable select =" format-number( 1000*( 24*3600*( $year*365-719527 +floor($year div 4) -floor($year div 100) +floor($year div 400) +sum($date:month/*[$month>=position()]) +format-number(substring($date,5,2)-1,0) -(2>$month and (($year mod 4=0 and $year mod 100!=0) or $year mod 400=0))) +format-number( concat(0,substring($time,7, (substring($time,6,1)=':')*2)) +substring($time,1,2)*3600 +substring($time,4,2)*60,0) +$utc-offset*60) +format-number( round( (substring($time,9,1)='.') *1000*substring-before( translate( concat('0.',substring-after($time,'.'),'_'), '+-','__'),'_')),0),0)"/> </ xsl:template >
< xsl:template name ="date:timestamp" > < xsl:param name ="date-time" /> < xsl:variable name ="compact" select =" normalize-space( translate($date-time,'TZ ',''))" /> < xsl:variable name ="year" select =" translate( substring($compact,1, 4+(starts-with($compact,'+') or starts-with($compact,'-'))), '+','')"/> < xsl:variable name ="date" select ="substring-after($compact,$year)" /> < xsl:variable name ="time" select ="substring($date,7)" /> < xsl:variable name ="month" select ="format-number(substring($date,2,2)-1,0)" /> < xsl:variable name ="utc-offset" > < xsl:variable name ="raw" select =" concat( substring-after($time,'+'), substring-after($time,'-'))"/> < xsl:variable select =" format-number( (contains($time,'-')-.5) *2*(substring($raw,1,2)*60 +substring($raw,4,2)),0)"/> </ xsl:variable > < xsl:variable select =" format-number( 1000*( 24*3600*( $year*365-719527 +floor($year div 4) -floor($year div 100) +floor($year div 400) +sum($date:month/*[$month>=position()]) +format-number(substring($date,5,2)-1,0) -(2>$month and (($year mod 4=0 and $year mod 100!=0) or $year mod 400=0))) +format-number( concat(0,substring($time,7, (substring($time,6,1)=':')*2)) +substring($time,1,2)*3600 +substring($time,4,2)*60,0) +$utc-offset*60) +format-number( round( (substring($time,9,1)='.') *1000*substring-before( translate( concat('0.',substring-after($time,'.'),'_'), '+-','__'),'_')),0),0)"/> </ xsl:template >
< xsl:template name ="date:timestamp" > < xsl:param name ="date-time" /> < xsl:variable name ="compact" select =" normalize-space( translate($date-time,'TZ ',''))" /> < xsl:variable name ="year" select =" translate( substring($compact,1, 4+(starts-with($compact,'+') or starts-with($compact,'-'))), '+','')"/> < xsl:variable name ="date" select ="substring-after($compact,$year)" /> < xsl:variable name ="time" select ="substring($date,7)" /> < xsl:variable name ="month" select ="format-number(substring($date,2,2)-1,0)" /> < xsl:variable name ="utc-offset" > < xsl:variable name ="raw" select =" concat( substring-after($time,'+'), substring-after($time,'-'))"/> < xsl:variable select =" format-number( (contains($time,'-')-.5) *2*(substring($raw,1,2)*60 +substring($raw,4,2)),0)"/> </ xsl:variable > < xsl:variable select =" format-number( 1000*( 24*3600*( $year*365-719527 +floor($year div 4) -floor($year div 100) +floor($year div 400) +sum($date:month/*[$month>=position()]) +format-number(substring($date,5,2)-1,0) -(2>$month and (($year mod 4=0 and $year mod 100!=0) or $year mod 400=0))) +format-number( concat(0,substring($time,7, (substring($time,6,1)=':')*2)) +substring($time,1,2)*3600 +substring($time,4,2)*60,0) +$utc-offset*60) +format-number( round( (substring($time,9,1)='.') *1000*substring-before( translate( concat('0.',substring-after($time,'.'),'_'), '+-','__'),'_')),0),0)"/> </ xsl:template >
< xsl:template name ="date:timestamp" > < xsl:param name ="date-time" /> < xsl:variable name ="compact" select =" normalize-space( translate($date-time,'TZ ',''))" /> < xsl:variable name ="year" select =" translate( substring($compact,1, 4+(starts-with($compact,'+') or starts-with($compact,'-'))), '+','')"/> < xsl:variable name ="date" select ="substring-after($compact,$year)" /> < xsl:variable name ="time" select ="substring($date,7)" /> < xsl:variable name ="month" select ="format-number(substring($date,2,2)-1,0)" /> < xsl:variable name ="utc-offset" > < xsl:variable name ="raw" select =" concat( substring-after($time,'+'), substring-after($time,'-'))"/> < xsl:variable select =" format-number( (contains($time,'-')-.5) *2*(substring($raw,1,2)*60 +substring($raw,4,2)),0)"/> </ xsl:variable > < xsl:variable select =" format-number( 1000*( 24*3600*( $year*365-719527 +floor($year div 4) -floor($year div 100) +floor($year div 400) +sum($date:month/*[$month>=position()]) +format-number(substring($date,5,2)-1,0) -(2>$month and (($year mod 4=0 and $year mod 100!=0) or $year mod 400=0))) +format-number( concat(0,substring($time,7, (substring($time,6,1)=':')*2)) +substring($time,1,2)*3600 +substring($time,4,2)*60,0) +$utc-offset*60) +format-number( round( (substring($time,9,1)='.') *1000*substring-before( translate( concat('0.',substring-after($time,'.'),'_'), '+-','__'),'_')),0),0)"/> </ xsl:template >
< xsl:template name ="date:timestamp" > < xsl:param name ="date-time" /> < xsl:variable name ="compact" select =" normalize-space( translate($date-time,'TZ ',''))" /> < xsl:variable name ="year" select =" translate( substring($compact,1, 4+(starts-with($compact,'+') or starts-with($compact,'-'))), '+','')"/> < xsl:variable name ="date" select ="substring-after($compact,$year)" /> < xsl:variable name ="time" select ="substring($date,7)" /> < xsl:variable name ="month" select ="format-number(substring($date,2,2)-1,0)" /> < xsl:variable name ="utc-offset" > < xsl:variable name ="raw" select =" concat( substring-after($time,'+'), substring-after($time,'-'))"/> < xsl:variable select =" format-number( (contains($time,'-')-.5) *2*(substring($raw,1,2)*60 +substring($raw,4,2)),0)"/> </ xsl:variable > < xsl:variable select =" format-number( 1000*( 24*3600*( $year*365-719527 +floor($year div 4) -floor($year div 100) +floor($year div 400) +sum($date:month/*[$month>=position()]) +format-number(substring($date,5,2)-1,0) -(2>$month and (($year mod 4=0 and $year mod 100!=0) or $year mod 400=0))) +format-number( concat(0,substring($time,7, (substring($time,6,1)=':')*2)) +substring($time,1,2)*3600 +substring($time,4,2)*60,0) +$utc-offset*60) +format-number( round( (substring($time,9,1)='.') *1000*substring-before( translate( concat('0.',substring-after($time,'.'),'_'), '+-','__'),'_')),0),0)"/> </ xsl:template >
< xsl:template name ="date:timestamp" > < xsl:param name ="date-time" /> < xsl:variable name ="compact" select =" normalize-space( translate($date-time,'TZ ',''))" /> < xsl:variable name ="year" select =" translate( substring($compact,1, 4+(starts-with($compact,'+') or starts-with($compact,'-'))), '+','')"/> < xsl:variable name ="date" select ="substring-after($compact,$year)" /> < xsl:variable name ="time" select ="substring($date,7)" /> < xsl:variable name ="month" select ="format-number(substring($date,2,2)-1,0)" /> < xsl:variable name ="utc-offset" > < xsl:variable name ="raw" select =" concat( substring-after($time,'+'), substring-after($time,'-'))"/> < xsl:variable select =" format-number( (contains($time,'-')-.5) *2*(substring($raw,1,2)*60 +substring($raw,4,2)),0)"/> </ xsl:variable > < xsl:variable select =" format-number( 1000*( 24*3600*( $year*365-719527 +floor($year div 4) -floor($year div 100) +floor($year div 400) +sum($date:month/*[$month>=position()]) +format-number(substring($date,5,2)-1,0) -(2>$month and (($year mod 4=0 and $year mod 100!=0) or $year mod 400=0))) +format-number( concat(0,substring($time,7, (substring($time,6,1)=':')*2)) +substring($time,1,2)*3600 +substring($time,4,2)*60,0) +$utc-offset*60) +format-number( round( (substring($time,9,1)='.') *1000*substring-before( translate( concat('0.',substring-after($time,'.'),'_'), '+-','__'),'_')),0),0)"/> </ xsl:template >
< xsl:template name ="date:timestamp" > < xsl:param name ="date-time" /> < xsl:variable name ="compact" select =" normalize-space( translate($date-time,'TZ ',''))" /> < xsl:variable name ="year" select =" translate( substring($compact,1, 4+(starts-with($compact,'+') or starts-with($compact,'-'))), '+','')"/> < xsl:variable name ="date" select ="substring-after($compact,$year)" /> < xsl:variable name ="time" select ="substring($date,7)" /> < xsl:variable name ="month" select ="format-number(substring($date,2,2)-1,0)" /> < xsl:variable name ="utc-offset" > < xsl:variable name ="raw" select =" concat( substring-after($time,'+'), substring-after($time,'-'))"/> < xsl:variable select =" format-number( (contains($time,'-')-.5) *2*(substring($raw,1,2)*60 +substring($raw,4,2)),0)"/> </ xsl:variable > < xsl:variable select =" format-number( 1000*( 24*3600*( $year*365-719527 +floor($year div 4) -floor($year div 100) +floor($year div 400) +sum($date:month/*[$month>=position()]) +format-number(substring($date,5,2)-1,0) -(2>$month and (($year mod 4=0 and $year mod 100!=0) or $year mod 400=0))) +format-number( concat(0,substring($time,7, (substring($time,6,1)=':')*2)) +substring($time,1,2)*3600 +substring($time,4,2)*60,0) +$utc-offset*60) +format-number( round( (substring($time,9,1)='.') *1000*substring-before( translate( concat('0.',substring-after($time,'.'),'_'), '+-','__'),'_')),0),0)"/> </ xsl:template >
< xsl:template name ="date:timestamp" > < xsl:param name ="date-time" /> < xsl:variable name ="compact" select =" normalize-space( translate($date-time,'TZ ',''))" /> < xsl:variable name ="year" select =" translate( substring($compact,1, 4+(starts-with($compact,'+') or starts-with($compact,'-'))), '+','')"/> < xsl:variable name ="date" select ="substring-after($compact,$year)" /> < xsl:variable name ="time" select ="substring($date,7)" /> < xsl:variable name ="month" select ="format-number(substring($date,2,2)-1,0)" /> < xsl:variable name ="utc-offset" > < xsl:variable name ="raw" select =" concat( substring-after($time,'+'), substring-after($time,'-'))"/> < xsl:variable select =" format-number( (contains($time,'-')-.5) *2*(substring($raw,1,2)*60 +substring($raw,4,2)),0)"/> </ xsl:variable > < xsl:variable select =" format-number( 1000*( 24*3600*( $year*365-719527 +floor($year div 4) -floor($year div 100) +floor($year div 400) +sum($date:month/*[$month>=position()]) +format-number(substring($date,5,2)-1,0) -(2>$month and (($year mod 4=0 and $year mod 100!=0) or $year mod 400=0))) +format-number( concat(0,substring($time,7, (substring($time,6,1)=':')*2)) +substring($time,1,2)*3600 +substring($time,4,2)*60,0) +$utc-offset*60) +format-number( round( (substring($time,9,1)='.') *1000*substring-before( translate( concat('0.',substring-after($time,'.'),'_'), '+-','__'),'_')),0),0)"/> </ xsl:template >
< xsl:template name ="date:timestamp" > < xsl:param name ="date-time" /> < xsl:variable name ="compact" select =" normalize-space( translate($date-time,'TZ ',''))" /> < xsl:variable name ="year" select =" translate( substring($compact,1, 4+(starts-with($compact,'+') or starts-with($compact,'-'))), '+','')"/> < xsl:variable name ="date" select ="substring-after($compact,$year)" /> < xsl:variable name ="time" select ="substring($date,7)" /> < xsl:variable name ="month" select ="format-number(substring($date,2,2)-1,0)" /> < xsl:variable name ="utc-offset" > < xsl:variable name ="raw" select =" concat( substring-after($time,'+'), substring-after($time,'-'))"/> < xsl:variable select =" format-number( (contains($time,'-')-.5) *2*(substring($raw,1,2)*60 +substring($raw,4,2)),0)"/> </ xsl:variable > < xsl:variable select =" format-number( 1000*( 24*3600*( $year*365-719527 +floor($year div 4) -floor($year div 100) +floor($year div 400) +sum($date:month/*[$month>=position()]) +format-number(substring($date,5,2)-1,0) -(2>$month and (($year mod 4=0 and $year mod 100!=0) or $year mod 400=0))) +format-number( concat(0,substring($time,7, (substring($time,6,1)=':')*2)) +substring($time,1,2)*3600 +substring($time,4,2)*60,0) +$utc-offset*60) +format-number( round( (substring($time,9,1)='.') *1000*substring-before( translate( concat('0.',substring-after($time,'.'),'_'), '+-','__'),'_')),0),0)"/> </ xsl:template >
< xsl:template name ="date:timestamp" > < xsl:param name ="date-time" /> < xsl:variable name ="compact" select =" normalize-space( translate($date-time,'TZ ',''))" /> < xsl:variable name ="year" select =" translate( substring($compact,1, 4+(starts-with($compact,'+') or starts-with($compact,'-'))), '+','')"/> < xsl:variable name ="date" select ="substring-after($compact,$year)" /> < xsl:variable name ="time" select ="substring($date,7)" /> < xsl:variable name ="month" select ="format-number(substring($date,2,2)-1,0)" /> < xsl:variable name ="utc-offset" > < xsl:variable name ="raw" select =" concat( substring-after($time,'+'), substring-after($time,'-'))"/> < xsl:variable select =" format-number( (contains($time,'-')-.5) *2*(substring($raw,1,2)*60 +substring($raw,4,2)),0)"/> </ xsl:variable > < xsl:variable select =" format-number( 1000*( 24*3600*( $year*365-719527 +floor($year div 4) -floor($year div 100) +floor($year div 400) +sum($date:month/*[$month>=position()]) +format-number(substring($date,5,2)-1,0) -(2>$month and (($year mod 4=0 and $year mod 100!=0) or $year mod 400=0))) +format-number( concat(0,substring($time,7, (substring($time,6,1)=':')*2)) +substring($time,1,2)*3600 +substring($time,4,2)*60,0) +$utc-offset*60) +format-number( round( (substring($time,9,1)='.') *1000*substring-before( translate( concat('0.',substring-after($time,'.'),'_'), '+-','__'),'_')),0),0)"/> </ xsl:template >
< xsl:template name ="date:timestamp" > < xsl:param name ="date-time" /> < xsl:variable name ="compact" select =" normalize-space( translate($date-time,'TZ ',''))" /> < xsl:variable name ="year" select =" translate( substring($compact,1, 4+(starts-with($compact,'+') or starts-with($compact,'-'))), '+','')"/> < xsl:variable name ="date" select ="substring-after($compact,$year)" /> < xsl:variable name ="time" select ="substring($date,7)" /> < xsl:variable name ="month" select ="format-number(substring($date,2,2)-1,0)" /> < xsl:variable name ="utc-offset" > < xsl:variable name ="raw" select =" concat( substring-after($time,'+'), substring-after($time,'-'))"/> < xsl:variable select =" format-number( (contains($time,'-')-.5) *2*(substring($raw,1,2)*60 +substring($raw,4,2)),0)"/> </ xsl:variable > < xsl:variable select =" format-number( 1000*( 24*3600*( $year*365-719527 +floor($year div 4) -floor($year div 100) +floor($year div 400) +sum($date:month/*[$month>=position()]) +format-number(substring($date,5,2)-1,0) -(2>$month and (($year mod 4=0 and $year mod 100!=0) or $year mod 400=0))) +format-number( concat(0,substring($time,7, (substring($time,6,1)=':')*2)) +substring($time,1,2)*3600 +substring($time,4,2)*60,0) +$utc-offset*60) +format-number( round( (substring($time,9,1)='.') *1000*substring-before( translate( concat('0.',substring-after($time,'.'),'_'), '+-','__'),'_')),0),0)"/> </ xsl:template >
< xsl:template name ="date:timestamp" > < xsl:param name ="date-time" /> < xsl:variable name ="compact" select =" normalize-space( translate($date-time,'TZ ',''))" /> < xsl:variable name ="year" select =" translate( substring($compact,1, 4+(starts-with($compact,'+') or starts-with($compact,'-'))), '+','')"/> < xsl:variable name ="date" select ="substring-after($compact,$year)" /> < xsl:variable name ="time" select ="substring($date,7)" /> < xsl:variable name ="month" select ="format-number(substring($date,2,2)-1,0)" /> < xsl:variable name ="utc-offset" > < xsl:variable name ="raw" select =" concat( substring-after($time,'+'), substring-after($time,'-'))"/> < xsl:variable select =" format-number( (contains($time,'-')-.5) *2*(substring($raw,1,2)*60 +substring($raw,4,2)),0)"/> </ xsl:variable > < xsl:variable select =" format-number( 1000*( 24*3600*( $year*365-719527 +floor($year div 4) -floor($year div 100) +floor($year div 400) +sum($date:month/*[$month>=position()]) +format-number(substring($date,5,2)-1,0) -(2>$month and (($year mod 4=0 and $year mod 100!=0) or $year mod 400=0))) +format-number( concat(0,substring($time,7, (substring($time,6,1)=':')*2)) +substring($time,1,2)*3600 +substring($time,4,2)*60,0) +$utc-offset*60) +format-number( round( (substring($time,9,1)='.') *1000*substring-before( translate( concat('0.',substring-after($time,'.'),'_'), '+-','__'),'_')),0),0)"/> </ xsl:template >
< xsl:template name ="date:timestamp" > < xsl:param name ="date-time" /> < xsl:variable name ="compact" select =" normalize-space( translate($date-time,'TZ ',''))" /> < xsl:variable name ="year" select =" translate( substring($compact,1, 4+(starts-with($compact,'+') or starts-with($compact,'-'))), '+','')"/> < xsl:variable name ="date" select ="substring-after($compact,$year)" /> < xsl:variable name ="time" select ="substring($date,7)" /> < xsl:variable name ="month" select ="format-number(substring($date,2,2)-1,0)" /> < xsl:variable name ="utc-offset" > < xsl:variable name ="raw" select =" concat( substring-after($time,'+'), substring-after($time,'-'))"/> < xsl:variable select =" format-number( (contains($time,'-')-.5) *2*(substring($raw,1,2)*60 +substring($raw,4,2)),0)"/> </ xsl:variable > < xsl:variable select =" format-number( 1000*( 24*3600*( $year*365-719527 +floor($year div 4) -floor($year div 100) +floor($year div 400) +sum($date:month/*[$month>=position()]) +format-number(substring($date,5,2)-1,0) -(2>$month and (($year mod 4=0 and $year mod 100!=0) or $year mod 400=0))) +format-number( concat(0,substring($time,7, (substring($time,6,1)=':')*2)) +substring($time,1,2)*3600 +substring($time,4,2)*60,0) +$utc-offset*60) +format-number( round( (substring($time,9,1)='.') *1000*substring-before( translate( concat('0.',substring-after($time,'.'),'_'), '+-','__'),'_')),0),0)"/> </ xsl:template >
< xsl:template name ="date:timestamp" > < xsl:param name ="date-time" /> < xsl:variable name ="compact" select =" normalize-space( translate($date-time,'TZ ',''))" /> < xsl:variable name ="year" select =" translate( substring($compact,1, 4+(starts-with($compact,'+') or starts-with($compact,'-'))), '+','')"/> < xsl:variable name ="date" select ="substring-after($compact,$year)" /> < xsl:variable name ="time" select ="substring($date,7)" /> < xsl:variable name ="month" select ="format-number(substring($date,2,2)-1,0)" /> < xsl:variable name ="utc-offset" > < xsl:variable name ="raw" select =" concat( substring-after($time,'+'), substring-after($time,'-'))"/> < xsl:variable select =" format-number( (contains($time,'-')-.5) *2*(substring($raw,1,2)*60 +substring($raw,4,2)),0)"/> </ xsl:variable > < xsl:variable select =" format-number( 1000*( 24*3600*( $year*365-719527 +floor($year div 4) -floor($year div 100) +floor($year div 400) +sum($date:month/*[$month>=position()]) +format-number(substring($date,5,2)-1,0) -(2>$month and (($year mod 4=0 and $year mod 100!=0) or $year mod 400=0))) +format-number( concat(0,substring($time,7, (substring($time,6,1)=':')*2)) +substring($time,1,2)*3600 +substring($time,4,2)*60,0) +$utc-offset*60) +format-number( round( (substring($time,9,1)='.') *1000*substring-before( translate( concat('0.',substring-after($time,'.'),'_'), '+-','__'),'_')),0),0)"/> </ xsl:template >
< xsl:template name ="date:timestamp" > < xsl:param name ="date-time" /> < xsl:variable name ="compact" select =" normalize-space( translate($date-time,'TZ ',''))" /> < xsl:variable name ="year" select =" translate( substring($compact,1, 4+(starts-with($compact,'+') or starts-with($compact,'-'))), '+','')"/> < xsl:variable name ="date" select ="substring-after($compact,$year)" /> < xsl:variable name ="time" select ="substring($date,7)" /> < xsl:variable name ="month" select ="format-number(substring($date,2,2)-1,0)" /> < xsl:variable name ="utc-offset" > < xsl:variable name ="raw" select =" concat( substring-after($time,'+'), substring-after($time,'-'))"/> < xsl:variable select =" format-number( (contains($time,'-')-.5) *2*(substring($raw,1,2)*60 +substring($raw,4,2)),0)"/> </ xsl:variable > < xsl:variable select =" format-number( 1000*( 24*3600*( $year*365-719527 +floor($year div 4) -floor($year div 100) +floor($year div 400) +sum($date:month/*[$month>=position()]) +format-number(substring($date,5,2)-1,0) -(2>$month and (($year mod 4=0 and $year mod 100!=0) or $year mod 400=0))) +format-number( concat(0,substring($time,7, (substring($time,6,1)=':')*2)) +substring($time,1,2)*3600 +substring($time,4,2)*60,0) +$utc-offset*60) +format-number( round( (substring($time,9,1)='.') *1000*substring-before( translate( concat('0.',substring-after($time,'.'),'_'), '+-','__'),'_')),0),0)"/> </ xsl:template >
< xsl:template name ="date:timestamp" > < xsl:param name ="date-time" /> < xsl:variable name ="compact" select =" normalize-space( translate($date-time,'TZ ',''))" /> < xsl:variable name ="year" select =" translate( substring($compact,1, 4+(starts-with($compact,'+') or starts-with($compact,'-'))), '+','')"/> < xsl:variable name ="date" select ="substring-after($compact,$year)" /> < xsl:variable name ="time" select ="substring($date,7)" /> < xsl:variable name ="month" select ="format-number(substring($date,2,2)-1,0)" /> < xsl:variable name ="utc-offset" > < xsl:variable name ="raw" select =" concat( substring-after($time,'+'), substring-after($time,'-'))"/> < xsl:variable select =" format-number( (contains($time,'-')-.5) *2*(substring($raw,1,2)*60 +substring($raw,4,2)),0)"/> </ xsl:variable > < xsl:variable select =" format-number( 1000*( 24*3600*( $year*365-719527 +floor($year div 4) -floor($year div 100) +floor($year div 400) +sum($date:month/*[$month>=position()]) +format-number(substring($date,5,2)-1,0) -(2>$month and (($year mod 4=0 and $year mod 100!=0) or $year mod 400=0))) +format-number( concat(0,substring($time,7, (substring($time,6,1)=':')*2)) +substring($time,1,2)*3600 +substring($time,4,2)*60,0) +$utc-offset*60) +format-number( round( (substring($time,9,1)='.') *1000*substring-before( translate( concat('0.',substring-after($time,'.'),'_'), '+-','__'),'_')),0),0)"/> </ xsl:template >
< xsl:template name ="date:timestamp" > < xsl:param name ="date-time" /> < xsl:variable name ="compact" select =" normalize-space( translate($date-time,'TZ ',''))" /> < xsl:variable name ="year" select =" translate( substring($compact,1, 4+(starts-with($compact,'+') or starts-with($compact,'-'))), '+','')"/> < xsl:variable name ="date" select ="substring-after($compact,$year)" /> < xsl:variable name ="time" select ="substring($date,7)" /> < xsl:variable name ="month" select ="format-number(substring($date,2,2)-1,0)" /> < xsl:variable name ="utc-offset" > < xsl:variable name ="raw" select =" concat( substring-after($time,'+'), substring-after($time,'-'))"/> < xsl:variable select =" format-number( (contains($time,'-')-.5) *2*(substring($raw,1,2)*60 +substring($raw,4,2)),0)"/> </ xsl:variable > < xsl:variable select =" format-number( 1000*( 24*3600*( $year*365-719527 +floor($year div 4) -floor($year div 100) +floor($year div 400) +sum($date:month/*[$month>=position()]) +format-number(substring($date,5,2)-1,0) -(2>$month and (($year mod 4=0 and $year mod 100!=0) or $year mod 400=0))) +format-number( concat(0,substring($time,7, (substring($time,6,1)=':')*2)) +substring($time,1,2)*3600 +substring($time,4,2)*60,0) +$utc-offset*60) +format-number( round( (substring($time,9,1)='.') *1000*substring-before( translate( concat('0.',substring-after($time,'.'),'_'), '+-','__'),'_')),0),0)"/> </ xsl:template >
< xsl:template name ="date:timestamp" > < xsl:param name ="date-time" /> < xsl:variable name ="compact" select =" normalize-space( translate($date-time,'TZ ',''))" /> < xsl:variable name ="year" select =" translate( substring($compact,1, 4+(starts-with($compact,'+') or starts-with($compact,'-'))), '+','')"/> < xsl:variable name ="date" select ="substring-after($compact,$year)" /> < xsl:variable name ="time" select ="substring($date,7)" /> < xsl:variable name ="month" select ="format-number(substring($date,2,2)-1,0)" /> < xsl:variable name ="utc-offset" > < xsl:variable name ="raw" select =" concat( substring-after($time,'+'), substring-after($time,'-'))"/> < xsl:variable select =" format-number( (contains($time,'-')-.5) *2*(substring($raw,1,2)*60 +substring($raw,4,2)),0)"/> </ xsl:variable > < xsl:variable select =" format-number( 1000*( 24*3600*( $year*365-719527 +floor($year div 4) -floor($year div 100) +floor($year div 400) +sum($date:month/*[$month>=position()]) +format-number(substring($date,5,2)-1,0) -(2>$month and (($year mod 4=0 and $year mod 100!=0) or $year mod 400=0))) +format-number( concat(0,substring($time,7, (substring($time,6,1)=':')*2)) +substring($time,1,2)*3600 +substring($time,4,2)*60,0) +$utc-offset*60) +format-number( round( (substring($time,9,1)='.') *1000*substring-before( translate( concat('0.',substring-after($time,'.'),'_'), '+-','__'),'_')),0),0)"/> </ xsl:template >
< xsl:template name ="date:timestamp" > < xsl:param name ="date-time" /> < xsl:variable name ="compact" select =" normalize-space( translate($date-time,'TZ ',''))" /> < xsl:variable name ="year" select =" translate( substring($compact,1, 4+(starts-with($compact,'+') or starts-with($compact,'-'))), '+','')"/> < xsl:variable name ="date" select ="substring-after($compact,$year)" /> < xsl:variable name ="time" select ="substring($date,7)" /> < xsl:variable name ="month" select ="format-number(substring($date,2,2)-1,0)" /> < xsl:variable name ="utc-offset" > < xsl:variable name ="raw" select =" concat( substring-after($time,'+'), substring-after($time,'-'))"/> < xsl:variable select =" format-number( (contains($time,'-')-.5) *2*(substring($raw,1,2)*60 +substring($raw,4,2)),0)"/> </ xsl:variable > < xsl:variable select =" format-number( 1000*( 24*3600*( $year*365-719527 +floor($year div 4) -floor($year div 100) +floor($year div 400) +sum($date:month/*[$month>=position()]) +format-number(substring($date,5,2)-1,0) -(2>$month and (($year mod 4=0 and $year mod 100!=0) or $year mod 400=0))) +format-number( concat(0,substring($time,7, (substring($time,6,1)=':')*2)) +substring($time,1,2)*3600 +substring($time,4,2)*60,0) +$utc-offset*60) +format-number( round( (substring($time,9,1)='.') *1000*substring-before( translate( concat('0.',substring-after($time,'.'),'_'), '+-','__'),'_')),0),0)"/> </ xsl:template >
< xsl:template name ="date:timestamp" > < xsl:param name ="date-time" /> < xsl:variable name ="compact" select =" normalize-space( translate($date-time,'TZ ',''))" /> < xsl:variable name ="year" select =" translate( substring($compact,1, 4+(starts-with($compact,'+') or starts-with($compact,'-'))), '+','')"/> < xsl:variable name ="date" select ="substring-after($compact,$year)" /> < xsl:variable name ="time" select ="substring($date,7)" /> < xsl:variable name ="month" select ="format-number(substring($date,2,2)-1,0)" /> < xsl:variable name ="utc-offset" > < xsl:variable name ="raw" select =" concat( substring-after($time,'+'), substring-after($time,'-'))"/> < xsl:variable select =" format-number( (contains($time,'-')-.5) *2*(substring($raw,1,2)*60 +substring($raw,4,2)),0)"/> </ xsl:variable > < xsl:variable select =" format-number( 1000*( 24*3600*( $year*365-719527 +floor($year div 4) -floor($year div 100) +floor($year div 400) +sum($date:month/*[$month>=position()]) +format-number(substring($date,5,2)-1,0) -(2>$month and (($year mod 4=0 and $year mod 100!=0) or $year mod 400=0))) +format-number( concat(0,substring($time,7, (substring($time,6,1)=':')*2)) +substring($time,1,2)*3600 +substring($time,4,2)*60,0) +$utc-offset*60) +format-number( round( (substring($time,9,1)='.') *1000*substring-before( translate( concat('0.',substring-after($time,'.'),'_'), '+-','__'),'_')),0),0)"/> </ xsl:template >
< xsl:template name ="date:timestamp" > < xsl:param name ="date-time" /> < xsl:variable name ="compact" select =" normalize-space( translate($date-time,'TZ ',''))" /> < xsl:variable name ="year" select =" translate( substring($compact,1, 4+(starts-with($compact,'+') or starts-with($compact,'-'))), '+','')"/> < xsl:variable name ="date" select ="substring-after($compact,$year)" /> < xsl:variable name ="time" select ="substring($date,7)" /> < xsl:variable name ="month" select ="format-number(substring($date,2,2)-1,0)" /> < xsl:variable name ="utc-offset" > < xsl:variable name ="raw" select =" concat( substring-after($time,'+'), substring-after($time,'-'))"/> < xsl:variable select =" format-number( (contains($time,'-')-.5) *2*(substring($raw,1,2)*60 +substring($raw,4,2)),0)"/> </ xsl:variable > < xsl:variable select =" format-number( 1000*( 24*3600*( $year*365-719527 +floor($year div 4) -floor($year div 100) +floor($year div 400) +sum($date:month/*[$month>=position()]) +format-number(substring($date,5,2)-1,0) -(2>$month and (($year mod 4=0 and $year mod 100!=0) or $year mod 400=0))) +format-number( concat(0,substring($time,7, (substring($time,6,1)=':')*2)) +substring($time,1,2)*3600 +substring($time,4,2)*60,0) +$utc-offset*60) +format-number( round( (substring($time,9,1)='.') *1000*substring-before( translate( concat('0.',substring-after($time,'.'),'_'), '+-','__'),'_')),0),0)"/> </ xsl:template >
< xsl:template name ="date:timestamp" > < xsl:param name ="date-time" /> < xsl:variable name ="compact" select =" normalize-space( translate($date-time,'TZ ',''))" /> < xsl:variable name ="year" select =" translate( substring($compact,1, 4+(starts-with($compact,'+') or starts-with($compact,'-'))), '+','')"/> < xsl:variable name ="date" select ="substring-after($compact,$year)" /> < xsl:variable name ="time" select ="substring($date,7)" /> < xsl:variable name ="month" select ="format-number(substring($date,2,2)-1,0)" /> < xsl:variable name ="utc-offset" > < xsl:variable name ="raw" select =" concat( substring-after($time,'+'), substring-after($time,'-'))"/> < xsl:variable select =" format-number( (contains($time,'-')-.5) *2*(substring($raw,1,2)*60 +substring($raw,4,2)),0)"/> </ xsl:variable > < xsl:variable select =" format-number( 1000*( 24*3600*( $year*365-719527 +floor($year div 4) -floor($year div 100) +floor($year div 400) +sum($date:month/*[$month>=position()]) +format-number(substring($date,5,2)-1,0) -(2>$month and (($year mod 4=0 and $year mod 100!=0) or $year mod 400=0))) +format-number( concat(0,substring($time,7, (substring($time,6,1)=':')*2)) +substring($time,1,2)*3600 +substring($time,4,2)*60,0) +$utc-offset*60) +format-number( round( (substring($time,9,1)='.') *1000*substring-before( translate( concat('0.',substring-after($time,'.'),'_'), '+-','__'),'_')),0),0)"/> </ xsl:template >
< xsl:template name ="date:timestamp" > < xsl:param name ="date-time" /> < xsl:variable name ="compact" select =" normalize-space( translate($date-time,'TZ ',''))" /> < xsl:variable name ="year" select =" translate( substring($compact,1, 4+(starts-with($compact,'+') or starts-with($compact,'-'))), '+','')"/> < xsl:variable name ="date" select ="substring-after($compact,$year)" /> < xsl:variable name ="time" select ="substring($date,7)" /> < xsl:variable name ="month" select ="format-number(substring($date,2,2)-1,0)" /> < xsl:variable name ="utc-offset" > < xsl:variable name ="raw" select =" concat( substring-after($time,'+'), substring-after($time,'-'))"/> < xsl:variable select =" format-number( (contains($time,'-')-.5) *2*(substring($raw,1,2)*60 +substring($raw,4,2)),0)"/> </ xsl:variable > < xsl:variable select =" format-number( 1000*( 24*3600*( $year*365-719527 +floor($year div 4) -floor($year div 100) +floor($year div 400) +sum($date:month/*[$month>=position()]) +format-number(substring($date,5,2)-1,0) -(2>$month and (($year mod 4=0 and $year mod 100!=0) or $year mod 400=0))) +format-number( concat(0,substring($time,7, (substring($time,6,1)=':')*2)) +substring($time,1,2)*3600 +substring($time,4,2)*60,0) +$utc-offset*60) +format-number( round( (substring($time,9,1)='.') *1000*substring-before( translate( concat('0.',substring-after($time,'.'),'_'), '+-','__'),'_')),0),0)"/> </ xsl:template >
< xsl:template name ="date:timestamp" > < xsl:param name ="date-time" /> < xsl:variable name ="compact" select =" normalize-space( translate($date-time,'TZ ',''))" /> < xsl:variable name ="year" select =" translate( substring($compact,1, 4+(starts-with($compact,'+') or starts-with($compact,'-'))), '+','')"/> < xsl:variable name ="date" select ="substring-after($compact,$year)" /> < xsl:variable name ="time" select ="substring($date,7)" /> < xsl:variable name ="month" select ="format-number(substring($date,2,2)-1,0)" /> < xsl:variable name ="utc-offset" > < xsl:variable name ="raw" select =" concat( substring-after($time,'+'), substring-after($time,'-'))"/> < xsl:variable select =" format-number( (contains($time,'-')-.5) *2*(substring($raw,1,2)*60 +substring($raw,4,2)),0)"/> </ xsl:variable > < xsl:variable select =" format-number( 1000*( 24*3600*( $year*365-719527 +floor($year div 4) -floor($year div 100) +floor($year div 400) +sum($date:month/*[$month>=position()]) +format-number(substring($date,5,2)-1,0) -(2>$month and (($year mod 4=0 and $year mod 100!=0) or $year mod 400=0))) +format-number( concat(0,substring($time,7, (substring($time,6,1)=':')*2)) +substring($time,1,2)*3600 +substring($time,4,2)*60,0) +$utc-offset*60) +format-number( round( (substring($time,9,1)='.') *1000*substring-before( translate( concat('0.',substring-after($time,'.'),'_'), '+-','__'),'_')),0),0)"/> </ xsl:template >
< xsl:template name ="date:timestamp" > < xsl:param name ="date-time" /> < xsl:variable name ="compact" select =" normalize-space( translate($date-time,'TZ ',''))" /> < xsl:variable name ="year" select =" translate( substring($compact,1, 4+(starts-with($compact,'+') or starts-with($compact,'-'))), '+','')"/> < xsl:variable name ="date" select ="substring-after($compact,$year)" /> < xsl:variable name ="time" select ="substring($date,7)" /> < xsl:variable name ="month" select ="format-number(substring($date,2,2)-1,0)" /> < xsl:variable name ="utc-offset" > < xsl:variable name ="raw" select =" concat( substring-after($time,'+'), substring-after($time,'-'))"/> < xsl:variable select =" format-number( (contains($time,'-')-.5) *2*(substring($raw,1,2)*60 +substring($raw,4,2)),0)"/> </ xsl:variable > < xsl:variable select =" format-number( 1000*( 24*3600*( $year*365-719527 +floor($year div 4) -floor($year div 100) +floor($year div 400) +sum($date:month/*[$month>=position()]) +format-number(substring($date,5,2)-1,0) -(2>$month and (($year mod 4=0 and $year mod 100!=0) or $year mod 400=0))) +format-number( concat(0,substring($time,7, (substring($time,6,1)=':')*2)) +substring($time,1,2)*3600 +substring($time,4,2)*60,0) +$utc-offset*60) +format-number( round( (substring($time,9,1)='.') *1000*substring-before( translate( concat('0.',substring-after($time,'.'),'_'), '+-','__'),'_')),0),0)"/> </ xsl:template >
< xsl:template name ="date:timestamp" > < xsl:param name ="date-time" /> < xsl:variable name ="compact" select =" normalize-space( translate($date-time,'TZ ',''))" /> < xsl:variable name ="year" select =" translate( substring($compact,1, 4+(starts-with($compact,'+') or starts-with($compact,'-'))), '+','')"/> < xsl:variable name ="date" select ="substring-after($compact,$year)" /> < xsl:variable name ="time" select ="substring($date,7)" /> < xsl:variable name ="month" select ="format-number(substring($date,2,2)-1,0)" /> < xsl:variable name ="utc-offset" > < xsl:variable name ="raw" select =" concat( substring-after($time,'+'), substring-after($time,'-'))"/> < xsl:variable select =" format-number( (contains($time,'-')-.5) *2*(substring($raw,1,2)*60 +substring($raw,4,2)),0)"/> </ xsl:variable > < xsl:variable select =" format-number( 1000*( 24*3600*( $year*365-719527 +floor($year div 4) -floor($year div 100) +floor($year div 400) +sum($date:month/*[$month>=position()]) +format-number(substring($date,5,2)-1,0) -(2>$month and (($year mod 4=0 and $year mod 100!=0) or $year mod 400=0))) +format-number( concat(0,substring($time,7, (substring($time,6,1)=':')*2)) +substring($time,1,2)*3600 +substring($time,4,2)*60,0) +$utc-offset*60) +format-number( round( (substring($time,9,1)='.') *1000*substring-before( translate( concat('0.',substring-after($time,'.'),'_'), '+-','__'),'_')),0),0)"/> </ xsl:template >
< xsl:template name ="date:timestamp" > < xsl:param name ="date-time" /> < xsl:variable name ="compact" select =" normalize-space( translate($date-time,'TZ ',''))" /> < xsl:variable name ="year" select =" translate( substring($compact,1, 4+(starts-with($compact,'+') or starts-with($compact,'-'))), '+','')"/> < xsl:variable name ="date" select ="substring-after($compact,$year)" /> < xsl:variable name ="time" select ="substring($date,7)" /> < xsl:variable name ="month" select ="format-number(substring($date,2,2)-1,0)" /> < xsl:variable name ="utc-offset" > < xsl:variable name ="raw" select =" concat( substring-after($time,'+'), substring-after($time,'-'))"/> < xsl:variable select =" format-number( (contains($time,'-')-.5) *2*(substring($raw,1,2)*60 +substring($raw,4,2)),0)"/> </ xsl:variable > < xsl:variable select =" format-number( 1000*( 24*3600*( $year*365-719527 +floor($year div 4) -floor($year div 100) +floor($year div 400) +sum($date:month/*[$month>=position()]) +format-number(substring($date,5,2)-1,0) -(2>$month and (($year mod 4=0 and $year mod 100!=0) or $year mod 400=0))) +format-number( concat(0,substring($time,7, (substring($time,6,1)=':')*2)) +substring($time,1,2)*3600 +substring($time,4,2)*60,0) +$utc-offset*60) +format-number( round( (substring($time,9,1)='.') *1000*substring-before( translate( concat('0.',substring-after($time,'.'),'_'), '+-','__'),'_')),0),0)"/> </ xsl:template >
< xsl:template name ="date:timestamp" > < xsl:param name ="date-time" /> < xsl:variable name ="compact" select =" normalize-space( translate($date-time,'TZ ',''))" /> < xsl:variable name ="year" select =" translate( substring($compact,1, 4+(starts-with($compact,'+') or starts-with($compact,'-'))), '+','')"/> < xsl:variable name ="date" select ="substring-after($compact,$year)" /> < xsl:variable name ="time" select ="substring($date,7)" /> < xsl:variable name ="month" select ="format-number(substring($date,2,2)-1,0)" /> < xsl:variable name ="utc-offset" > < xsl:variable name ="raw" select =" concat( substring-after($time,'+'), substring-after($time,'-'))"/> < xsl:variable select =" format-number( (contains($time,'-')-.5) *2*(substring($raw,1,2)*60 +substring($raw,4,2)),0)"/> </ xsl:variable > < xsl:variable select =" format-number( 1000*( 24*3600*( $year*365-719527 +floor($year div 4) -floor($year div 100) +floor($year div 400) +sum($date:month/*[$month>=position()]) +format-number(substring($date,5,2)-1,0) -(2>$month and (($year mod 4=0 and $year mod 100!=0) or $year mod 400=0))) +format-number( concat(0,substring($time,7, (substring($time,6,1)=':')*2)) +substring($time,1,2)*3600 +substring($time,4,2)*60,0) +$utc-offset*60) +format-number( round( (substring($time,9,1)='.') *1000*substring-before( translate( concat('0.',substring-after($time,'.'),'_'), '+-','__'),'_')),0),0)"/> </ xsl:template >
< xsl:template name ="date:timestamp" > < xsl:param name ="date-time" /> < xsl:variable name ="compact" select =" normalize-space( translate($date-time,'TZ ',''))" /> < xsl:variable name ="year" select =" translate( substring($compact,1, 4+(starts-with($compact,'+') or starts-with($compact,'-'))), '+','')"/> < xsl:variable name ="date" select ="substring-after($compact,$year)" /> < xsl:variable name ="time" select ="substring($date,7)" /> < xsl:variable name ="month" select ="format-number(substring($date,2,2)-1,0)" /> < xsl:variable name ="utc-offset" > < xsl:variable name ="raw" select =" concat( substring-after($time,'+'), substring-after($time,'-'))"/> < xsl:variable select =" format-number( (contains($time,'-')-.5) *2*(substring($raw,1,2)*60 +substring($raw,4,2)),0)"/> </ xsl:variable > < xsl:variable select =" format-number( 1000*( 24*3600*( $year*365-719527 +floor($year div 4) -floor($year div 100) +floor($year div 400) +sum($date:month/*[$month>=position()]) +format-number(substring($date,5,2)-1,0) -(2>$month and (($year mod 4=0 and $year mod 100!=0) or $year mod 400=0))) +format-number( concat(0,substring($time,7, (substring($time,6,1)=':')*2)) +substring($time,1,2)*3600 +substring($time,4,2)*60,0) +$utc-offset*60) +format-number( round( (substring($time,9,1)='.') *1000*substring-before( translate( concat('0.',substring-after($time,'.'),'_'), '+-','__'),'_')),0),0)"/> </ xsl:template >
< xsl:template name ="date:timestamp" > < xsl:param name ="date-time" /> < xsl:variable name ="compact" select =" normalize-space( translate($date-time,'TZ ',''))" /> < xsl:variable name ="year" select =" translate( substring($compact,1, 4+(starts-with($compact,'+') or starts-with($compact,'-'))), '+','')"/> < xsl:variable name ="date" select ="substring-after($compact,$year)" /> < xsl:variable name ="time" select ="substring($date,7)" /> < xsl:variable name ="month" select ="format-number(substring($date,2,2)-1,0)" /> < xsl:variable name ="utc-offset" > < xsl:variable name ="raw" select =" concat( substring-after($time,'+'), substring-after($time,'-'))"/> < xsl:variable select =" format-number( (contains($time,'-')-.5) *2*(substring($raw,1,2)*60 +substring($raw,4,2)),0)"/> </ xsl:variable > < xsl:variable select =" format-number( 1000*( 24*3600*( $year*365-719527 +floor($year div 4) -floor($year div 100) +floor($year div 400) +sum($date:month/*[$month>=position()]) +format-number(substring($date,5,2)-1,0) -(2>$month and (($year mod 4=0 and $year mod 100!=0) or $year mod 400=0))) +format-number( concat(0,substring($time,7, (substring($time,6,1)=':')*2)) +substring($time,1,2)*3600 +substring($time,4,2)*60,0) +$utc-offset*60) +format-number( round( (substring($time,9,1)='.') *1000*substring-before( translate( concat('0.',substring-after($time,'.'),'_'), '+-','__'),'_')),0),0)"/> </ xsl:template >
< xsl:template name ="date:timestamp" > < xsl:param name ="date-time" /> < xsl:variable name ="compact" select =" normalize-space( translate($date-time,'TZ ',''))" /> < xsl:variable name ="year" select =" translate( substring($compact,1, 4+(starts-with($compact,'+') or starts-with($compact,'-'))), '+','')"/> < xsl:variable name ="date" select ="substring-after($compact,$year)" /> < xsl:variable name ="time" select ="substring($date,7)" /> < xsl:variable name ="month" select ="format-number(substring($date,2,2)-1,0)" /> < xsl:variable name ="utc-offset" > < xsl:variable name ="raw" select =" concat( substring-after($time,'+'), substring-after($time,'-'))"/> < xsl:variable select =" format-number( (contains($time,'-')-.5) *2*(substring($raw,1,2)*60 +substring($raw,4,2)),0)"/> </ xsl:variable > < xsl:variable select =" format-number( 1000*( 24*3600*( $year*365-719527 +floor($year div 4) -floor($year div 100) +floor($year div 400) +sum($date:month/*[$month>=position()]) +format-number(substring($date,5,2)-1,0) -(2>$month and (($year mod 4=0 and $year mod 100!=0) or $year mod 400=0))) +format-number( concat(0,substring($time,7, (substring($time,6,1)=':')*2)) +substring($time,1,2)*3600 +substring($time,4,2)*60,0) +$utc-offset*60) +format-number( round( (substring($time,9,1)='.') *1000*substring-before( translate( concat('0.',substring-after($time,'.'),'_'), '+-','__'),'_')),0),0)"/> </ xsl:template >
< xsl:template name ="date:timestamp" > < xsl:param name ="date-time" /> < xsl:variable name ="compact" select =" normalize-space( translate($date-time,'TZ ',''))" /> < xsl:variable name ="year" select =" translate( substring($compact,1, 4+(starts-with($compact,'+') or starts-with($compact,'-'))), '+','')"/> < xsl:variable name ="date" select ="substring-after($compact,$year)" /> < xsl:variable name ="time" select ="substring($date,7)" /> < xsl:variable name ="month" select ="format-number(substring($date,2,2)-1,0)" /> < xsl:variable name ="utc-offset" > < xsl:variable name ="raw" select =" concat( substring-after($time,'+'), substring-after($time,'-'))"/> < xsl:variable select =" format-number( (contains($time,'-')-.5) *2*(substring($raw,1,2)*60 +substring($raw,4,2)),0)"/> </ xsl:variable > < xsl:variable select =" format-number( 1000*( 24*3600*( $year*365-719527 +floor($year div 4) -floor($year div 100) +floor($year div 400) +sum($date:month/*[$month>=position()]) +format-number(substring($date,5,2)-1,0) -(2>$month and (($year mod 4=0 and $year mod 100!=0) or $year mod 400=0))) +format-number( concat(0,substring($time,7, (substring($time,6,1)=':')*2)) +substring($time,1,2)*3600 +substring($time,4,2)*60,0) +$utc-offset*60) +format-number( round( (substring($time,9,1)='.') *1000*substring-before( translate( concat('0.',substring-after($time,'.'),'_'), '+-','__'),'_')),0),0)"/> </ xsl:template >
< xsl:template name ="date:timestamp" > < xsl:param name ="date-time" /> < xsl:variable name ="compact" select =" normalize-space( translate($date-time,'TZ ',''))" /> < xsl:variable name ="year" select =" translate( substring($compact,1, 4+(starts-with($compact,'+') or starts-with($compact,'-'))), '+','')"/> < xsl:variable name ="date" select ="substring-after($compact,$year)" /> < xsl:variable name ="time" select ="substring($date,7)" /> < xsl:variable name ="month" select ="format-number(substring($date,2,2)-1,0)" /> < xsl:variable name ="utc-offset" > < xsl:variable name ="raw" select =" concat( substring-after($time,'+'), substring-after($time,'-'))"/> < xsl:variable select =" format-number( (contains($time,'-')-.5) *2*(substring($raw,1,2)*60 +substring($raw,4,2)),0)"/> </ xsl:variable > < xsl:variable select =" format-number( 1000*( 24*3600*( $year*365-719527 +floor($year div 4) -floor($year div 100) +floor($year div 400) +sum($date:month/*[$month>=position()]) +format-number(substring($date,5,2)-1,0) -(2>$month and (($year mod 4=0 and $year mod 100!=0) or $year mod 400=0))) +format-number( concat(0,substring($time,7, (substring($time,6,1)=':')*2)) +substring($time,1,2)*3600 +substring($time,4,2)*60,0) +$utc-offset*60) +format-number( round( (substring($time,9,1)='.') *1000*substring-before( translate( concat('0.',substring-after($time,'.'),'_'), '+-','__'),'_')),0),0)"/> </ xsl:template >
< xsl:template name ="date:timestamp" > < xsl:param name ="date-time" /> < xsl:variable name ="compact" select =" normalize-space( translate($date-time,'TZ ',''))" /> < xsl:variable name ="year" select =" translate( substring($compact,1, 4+(starts-with($compact,'+') or starts-with($compact,'-'))), '+','')"/> < xsl:variable name ="date" select ="substring-after($compact,$year)" /> < xsl:variable name ="time" select ="substring($date,7)" /> < xsl:variable name ="month" select ="format-number(substring($date,2,2)-1,0)" /> < xsl:variable name ="utc-offset" > < xsl:variable name ="raw" select =" concat( substring-after($time,'+'), substring-after($time,'-'))"/> < xsl:variable select =" format-number( (contains($time,'-')-.5) *2*(substring($raw,1,2)*60 +substring($raw,4,2)),0)"/> </ xsl:variable > < xsl:variable select =" format-number( 1000*( 24*3600*( $year*365-719527 +floor($year div 4) -floor($year div 100) +floor($year div 400) +sum($date:month/*[$month>=position()]) +format-number(substring($date,5,2)-1,0) -(2>$month and (($year mod 4=0 and $year mod 100!=0) or $year mod 400=0))) +format-number( concat(0,substring($time,7, (substring($time,6,1)=':')*2)) +substring($time,1,2)*3600 +substring($time,4,2)*60,0) +$utc-offset*60) +format-number( round( (substring($time,9,1)='.') *1000*substring-before( translate( concat('0.',substring-after($time,'.'),'_'), '+-','__'),'_')),0),0)"/> </ xsl:template >
< xsl:template name ="date:timestamp" > < xsl:param name ="date-time" /> < xsl:variable name ="compact" select =" normalize-space( translate($date-time,'TZ ',''))" /> < xsl:variable name ="year" select =" translate( substring($compact,1, 4+(starts-with($compact,'+') or starts-with($compact,'-'))), '+','')"/> < xsl:variable name ="date" select ="substring-after($compact,$year)" /> < xsl:variable name ="time" select ="substring($date,7)" /> < xsl:variable name ="month" select ="format-number(substring($date,2,2)-1,0)" /> < xsl:variable name ="utc-offset" > < xsl:variable name ="raw" select =" concat( substring-after($time,'+'), substring-after($time,'-'))"/> < xsl:variable select =" format-number( (contains($time,'-')-.5) *2*(substring($raw,1,2)*60 +substring($raw,4,2)),0)"/> </ xsl:variable > < xsl:variable select =" format-number( 1000*( 24*3600*( $year*365-719527 +floor($year div 4) -floor($year div 100) +floor($year div 400) +sum($date:month/*[$month>=position()]) +format-number(substring($date,5,2)-1,0) -(2>$month and (($year mod 4=0 and $year mod 100!=0) or $year mod 400=0))) +format-number( concat(0,substring($time,7, (substring($time,6,1)=':')*2)) +substring($time,1,2)*3600 +substring($time,4,2)*60,0) +$utc-offset*60) +format-number( round( (substring($time,9,1)='.') *1000*substring-before( translate( concat('0.',substring-after($time,'.'),'_'), '+-','__'),'_')),0),0)"/> </ xsl:template >
< xsl:template name ="date:timestamp" > < xsl:param name ="date-time" /> < xsl:variable name ="compact" select =" normalize-space( translate($date-time,'TZ ',''))" /> < xsl:variable name ="year" select =" translate( substring($compact,1, 4+(starts-with($compact,'+') or starts-with($compact,'-'))), '+','')"/> < xsl:variable name ="date" select ="substring-after($compact,$year)" /> < xsl:variable name ="time" select ="substring($date,7)" /> < xsl:variable name ="month" select ="format-number(substring($date,2,2)-1,0)" /> < xsl:variable name ="utc-offset" > < xsl:variable name ="raw" select =" concat( substring-after($time,'+'), substring-after($time,'-'))"/> < xsl:variable select =" format-number( (contains($time,'-')-.5) *2*(substring($raw,1,2)*60 +substring($raw,4,2)),0)"/> </ xsl:variable > < xsl:variable select =" format-number( 1000*( 24*3600*( $year*365-719527 +floor($year div 4) -floor($year div 100) +floor($year div 400) +sum($date:month/*[$month>=position()]) +format-number(substring($date,5,2)-1,0) -(2>$month and (($year mod 4=0 and $year mod 100!=0) or $year mod 400=0))) +format-number( concat(0,substring($time,7, (substring($time,6,1)=':')*2)) +substring($time,1,2)*3600 +substring($time,4,2)*60,0) +$utc-offset*60) +format-number( round( (substring($time,9,1)='.') *1000*substring-before( translate( concat('0.',substring-after($time,'.'),'_'), '+-','__'),'_')),0),0)"/> </ xsl:template >
< xsl:template name ="date:timestamp" > < xsl:param name ="date-time" /> < xsl:variable name ="compact" select =" normalize-space( translate($date-time,'TZ ',''))" /> < xsl:variable name ="year" select =" translate( substring($compact,1, 4+(starts-with($compact,'+') or starts-with($compact,'-'))), '+','')"/> < xsl:variable name ="date" select ="substring-after($compact,$year)" /> < xsl:variable name ="time" select ="substring($date,7)" /> < xsl:variable name ="month" select ="format-number(substring($date,2,2)-1,0)" /> < xsl:variable name ="utc-offset" > < xsl:variable name ="raw" select =" concat( substring-after($time,'+'), substring-after($time,'-'))"/> < xsl:variable select =" format-number( (contains($time,'-')-.5) *2*(substring($raw,1,2)*60 +substring($raw,4,2)),0)"/> </ xsl:variable > < xsl:variable select =" format-number( 1000*( 24*3600*( $year*365-719527 +floor($year div 4) -floor($year div 100) +floor($year div 400) +sum($date:month/*[$month>=position()]) +format-number(substring($date,5,2)-1,0) -(2>$month and (($year mod 4=0 and $year mod 100!=0) or $year mod 400=0))) +format-number( concat(0,substring($time,7, (substring($time,6,1)=':')*2)) +substring($time,1,2)*3600 +substring($time,4,2)*60,0) +$utc-offset*60) +format-number( round( (substring($time,9,1)='.') *1000*substring-before( translate( concat('0.',substring-after($time,'.'),'_'), '+-','__'),'_')),0),0)"/> </ xsl:template >
< xsl:template name ="date:timestamp" > < xsl:param name ="date-time" /> < xsl:variable name ="compact" select =" normalize-space( translate($date-time,'TZ ',''))" /> < xsl:variable name ="year" select =" translate( substring($compact,1, 4+(starts-with($compact,'+') or starts-with($compact,'-'))), '+','')"/> < xsl:variable name ="date" select ="substring-after($compact,$year)" /> < xsl:variable name ="time" select ="substring($date,7)" /> < xsl:variable name ="month" select ="format-number(substring($date,2,2)-1,0)" /> < xsl:variable name ="utc-offset" > < xsl:variable name ="raw" select =" concat( substring-after($time,'+'), substring-after($time,'-'))"/> < xsl:variable select =" format-number( (contains($time,'-')-.5) *2*(substring($raw,1,2)*60 +substring($raw,4,2)),0)"/> </ xsl:variable > < xsl:variable select =" format-number( 1000*( 24*3600*( $year*365-719527 +floor($year div 4) -floor($year div 100) +floor($year div 400) +sum($date:month/*[$month>=position()]) +format-number(substring($date,5,2)-1,0) -(2>$month and (($year mod 4=0 and $year mod 100!=0) or $year mod 400=0))) +format-number( concat(0,substring($time,7, (substring($time,6,1)=':')*2)) +substring($time,1,2)*3600 +substring($time,4,2)*60,0) +$utc-offset*60) +format-number( round( (substring($time,9,1)='.') *1000*substring-before( translate( concat('0.',substring-after($time,'.'),'_'), '+-','__'),'_')),0),0)"/> </ xsl:template >
< xsl:template name ="date:timestamp" > < xsl:param name ="date-time" /> < xsl:variable name ="compact" select =" normalize-space( translate($date-time,'TZ ',''))" /> < xsl:variable name ="year" select =" translate( substring($compact,1, 4+(starts-with($compact,'+') or starts-with($compact,'-'))), '+','')"/> < xsl:variable name ="date" select ="substring-after($compact,$year)" /> < xsl:variable name ="time" select ="substring($date,7)" /> < xsl:variable name ="month" select ="format-number(substring($date,2,2)-1,0)" /> < xsl:variable name ="utc-offset" > < xsl:variable name ="raw" select =" concat( substring-after($time,'+'), substring-after($time,'-'))"/> < xsl:variable select =" format-number( (contains($time,'-')-.5) *2*(substring($raw,1,2)*60 +substring($raw,4,2)),0)"/> </ xsl:variable > < xsl:variable select =" format-number( 1000*( 24*3600*( $year*365-719527 +floor($year div 4) -floor($year div 100) +floor($year div 400) +sum($date:month/*[$month>=position()]) +format-number(substring($date,5,2)-1,0) -(2>$month and (($year mod 4=0 and $year mod 100!=0) or $year mod 400=0))) +format-number( concat(0,substring($time,7, (substring($time,6,1)=':')*2)) +substring($time,1,2)*3600 +substring($time,4,2)*60,0) +$utc-offset*60) +format-number( round( (substring($time,9,1)='.') *1000*substring-before( translate( concat('0.',substring-after($time,'.'),'_'), '+-','__'),'_')),0),0)"/> </ xsl:template >
< xsl:template name ="date:timestamp" > < xsl:param name ="date-time" /> < xsl:variable name ="compact" select =" normalize-space( translate($date-time,'TZ ',''))" /> < xsl:variable name ="year" select =" translate( substring($compact,1, 4+(starts-with($compact,'+') or starts-with($compact,'-'))), '+','')"/> < xsl:variable name ="date" select ="substring-after($compact,$year)" /> < xsl:variable name ="time" select ="substring($date,7)" /> < xsl:variable name ="month" select ="format-number(substring($date,2,2)-1,0)" /> < xsl:variable name ="utc-offset" > < xsl:variable name ="raw" select =" concat( substring-after($time,'+'), substring-after($time,'-'))"/> < xsl:variable select =" format-number( (contains($time,'-')-.5) *2*(substring($raw,1,2)*60 +substring($raw,4,2)),0)"/> </ xsl:variable > < xsl:variable select =" format-number( 1000*( 24*3600*( $year*365-719527 +floor($year div 4) -floor($year div 100) +floor($year div 400) +sum($date:month/*[$month>=position()]) +format-number(substring($date,5,2)-1,0) -(2>$month and (($year mod 4=0 and $year mod 100!=0) or $year mod 400=0))) +format-number( concat(0,substring($time,7, (substring($time,6,1)=':')*2)) +substring($time,1,2)*3600 +substring($time,4,2)*60,0) +$utc-offset*60) +format-number( round( (substring($time,9,1)='.') *1000*substring-before( translate( concat('0.',substring-after($time,'.'),'_'), '+-','__'),'_')),0),0)"/> </ xsl:template >
< xsl:template name ="date:timestamp" > < xsl:param name ="date-time" /> < xsl:variable name ="compact" select =" normalize-space( translate($date-time,'TZ ',''))" /> < xsl:variable name ="year" select =" translate( substring($compact,1, 4+(starts-with($compact,'+') or starts-with($compact,'-'))), '+','')"/> < xsl:variable name ="date" select ="substring-after($compact,$year)" /> < xsl:variable name ="time" select ="substring($date,7)" /> < xsl:variable name ="month" select ="format-number(substring($date,2,2)-1,0)" /> < xsl:variable name ="utc-offset" > < xsl:variable name ="raw" select =" concat( substring-after($time,'+'), substring-after($time,'-'))"/> < xsl:variable select =" format-number( (contains($time,'-')-.5) *2*(substring($raw,1,2)*60 +substring($raw,4,2)),0)"/> </ xsl:variable > < xsl:variable select =" format-number( 1000*( 24*3600*( $year*365-719527 +floor($year div 4) -floor($year div 100) +floor($year div 400) +sum($date:month/*[$month>=position()]) +format-number(substring($date,5,2)-1,0) -(2>$month and (($year mod 4=0 and $year mod 100!=0) or $year mod 400=0))) +format-number( concat(0,substring($time,7, (substring($time,6,1)=':')*2)) +substring($time,1,2)*3600 +substring($time,4,2)*60,0) +$utc-offset*60) +format-number( round( (substring($time,9,1)='.') *1000*substring-before( translate( concat('0.',substring-after($time,'.'),'_'), '+-','__'),'_')),0),0)"/> </ xsl:template >
< xsl:template name ="date:timestamp" > < xsl:param name ="date-time" /> < xsl:variable name ="compact" select =" normalize-space( translate($date-time,'TZ ',''))" /> < xsl:variable name ="year" select =" translate( substring($compact,1, 4+(starts-with($compact,'+') or starts-with($compact,'-'))), '+','')"/> < xsl:variable name ="date" select ="substring-after($compact,$year)" /> < xsl:variable name ="time" select ="substring($date,7)" /> < xsl:variable name ="month" select ="format-number(substring($date,2,2)-1,0)" /> < xsl:variable name ="utc-offset" > < xsl:variable name ="raw" select =" concat( substring-after($time,'+'), substring-after($time,'-'))"/> < xsl:variable select =" format-number( (contains($time,'-')-.5) *2*(substring($raw,1,2)*60 +substring($raw,4,2)),0)"/> </ xsl:variable > < xsl:variable select =" format-number( 1000*( 24*3600*( $year*365-719527 +floor($year div 4) -floor($year div 100) +floor($year div 400) +sum($date:month/*[$month>=position()]) +format-number(substring($date,5,2)-1,0) -(2>$month and (($year mod 4=0 and $year mod 100!=0) or $year mod 400=0))) +format-number( concat(0,substring($time,7, (substring($time,6,1)=':')*2)) +substring($time,1,2)*3600 +substring($time,4,2)*60,0) +$utc-offset*60) +format-number( round( (substring($time,9,1)='.') *1000*substring-before( translate( concat('0.',substring-after($time,'.'),'_'), '+-','__'),'_')),0),0)"/> </ xsl:template >
< xsl:template name ="date:timestamp" > < xsl:param name ="date-time" /> < xsl:variable name ="compact" select =" normalize-space( translate($date-time,'TZ ',''))" /> < xsl:variable name ="year" select =" translate( substring($compact,1, 4+(starts-with($compact,'+') or starts-with($compact,'-'))), '+','')"/> < xsl:variable name ="date" select ="substring-after($compact,$year)" /> < xsl:variable name ="time" select ="substring($date,7)" /> < xsl:variable name ="month" select ="format-number(substring($date,2,2)-1,0)" /> < xsl:variable name ="utc-offset" > < xsl:variable name ="raw" select =" concat( substring-after($time,'+'), substring-after($time,'-'))"/> < xsl:variable select =" format-number( (contains($time,'-')-.5) *2*(substring($raw,1,2)*60 +substring($raw,4,2)),0)"/> </ xsl:variable > < xsl:variable select =" format-number( 1000*( 24*3600*( $year*365-719527 +floor($year div 4) -floor($year div 100) +floor($year div 400) +sum($date:month/*[$month>=position()]) +format-number(substring($date,5,2)-1,0) -(2>$month and (($year mod 4=0 and $year mod 100!=0) or $year mod 400=0))) +format-number( concat(0,substring($time,7, (substring($time,6,1)=':')*2)) +substring($time,1,2)*3600 +substring($time,4,2)*60,0) +$utc-offset*60) +format-number( round( (substring($time,9,1)='.') *1000*substring-before( translate( concat('0.',substring-after($time,'.'),'_'), '+-','__'),'_')),0),0)"/> </ xsl:template >
< xsl:template name ="date:timestamp" > < xsl:param name ="date-time" /> < xsl:variable name ="compact" select =" normalize-space( translate($date-time,'TZ ',''))" /> < xsl:variable name ="year" select =" translate( substring($compact,1, 4+(starts-with($compact,'+') or starts-with($compact,'-'))), '+','')"/> < xsl:variable name ="date" select ="substring-after($compact,$year)" /> < xsl:variable name ="time" select ="substring($date,7)" /> < xsl:variable name ="month" select ="format-number(substring($date,2,2)-1,0)" /> < xsl:variable name ="utc-offset" > < xsl:variable name ="raw" select =" concat( substring-after($time,'+'), substring-after($time,'-'))"/> < xsl:variable select =" format-number( (contains($time,'-')-.5) *2*(substring($raw,1,2)*60 +substring($raw,4,2)),0)"/> </ xsl:variable > < xsl:variable select =" format-number( 1000*( 24*3600*( $year*365-719527 +floor($year div 4) -floor($year div 100) +floor($year div 400) +sum($date:month/*[$month>=position()]) +format-number(substring($date,5,2)-1,0) -(2>$month and (($year mod 4=0 and $year mod 100!=0) or $year mod 400=0))) +format-number( concat(0,substring($time,7, (substring($time,6,1)=':')*2)) +substring($time,1,2)*3600 +substring($time,4,2)*60,0) +$utc-offset*60) +format-number( round( (substring($time,9,1)='.') *1000*substring-before( translate( concat('0.',substring-after($time,'.'),'_'), '+-','__'),'_')),0),0)"/> </ xsl:template >
< xsl:template name ="date:timestamp" > < xsl:param name ="date-time" /> < xsl:variable name ="compact" select =" normalize-space( translate($date-time,'TZ ',''))" /> < xsl:variable name ="year" select =" translate( substring($compact,1, 4+(starts-with($compact,'+') or starts-with($compact,'-'))), '+','')"/> < xsl:variable name ="date" select ="substring-after($compact,$year)" /> < xsl:variable name ="time" select ="substring($date,7)" /> < xsl:variable name ="month" select ="format-number(substring($date,2,2)-1,0)" /> < xsl:variable name ="utc-offset" > < xsl:variable name ="raw" select =" concat( substring-after($time,'+'), substring-after($time,'-'))"/> < xsl:variable select =" format-number( (contains($time,'-')-.5) *2*(substring($raw,1,2)*60 +substring($raw,4,2)),0)"/> </ xsl:variable > < xsl:variable select =" format-number( 1000*( 24*3600*( $year*365-719527 +floor($year div 4) -floor($year div 100) +floor($year div 400) +sum($date:month/*[$month>=position()]) +format-number(substring($date,5,2)-1,0) -(2>$month and (($year mod 4=0 and $year mod 100!=0) or $year mod 400=0))) +format-number( concat(0,substring($time,7, (substring($time,6,1)=':')*2)) +substring($time,1,2)*3600 +substring($time,4,2)*60,0) +$utc-offset*60) +format-number( round( (substring($time,9,1)='.') *1000*substring-before( translate( concat('0.',substring-after($time,'.'),'_'), '+-','__'),'_')),0),0)"/> </ xsl:template >
< xsl:template name ="date:timestamp" > < xsl:param name ="date-time" /> < xsl:variable name ="compact" select =" normalize-space( translate($date-time,'TZ ',''))" /> < xsl:variable name ="year" select =" translate( substring($compact,1, 4+(starts-with($compact,'+') or starts-with($compact,'-'))), '+','')"/> < xsl:variable name ="date" select ="substring-after($compact,$year)" /> < xsl:variable name ="time" select ="substring($date,7)" /> < xsl:variable name ="month" select ="format-number(substring($date,2,2)-1,0)" /> < xsl:variable name ="utc-offset" > < xsl:variable name ="raw" select =" concat( substring-after($time,'+'), substring-after($time,'-'))"/> < xsl:variable select =" format-number( (contains($time,'-')-.5) *2*(substring($raw,1,2)*60 +substring($raw,4,2)),0)"/> </ xsl:variable > < xsl:variable select =" format-number( 1000*( 24*3600*( $year*365-719527 +floor($year div 4) -floor($year div 100) +floor($year div 400) +sum($date:month/*[$month>=position()]) +format-number(substring($date,5,2)-1,0) -(2>$month and (($year mod 4=0 and $year mod 100!=0) or $year mod 400=0))) +format-number( concat(0,substring($time,7, (substring($time,6,1)=':')*2)) +substring($time,1,2)*3600 +substring($time,4,2)*60,0) +$utc-offset*60) +format-number( round( (substring($time,9,1)='.') *1000*substring-before( translate( concat('0.',substring-after($time,'.'),'_'), '+-','__'),'_')),0),0)"/> </ xsl:template >
< xsl:template name ="date:timestamp" > < xsl:param name ="date-time" /> < xsl:variable name ="compact" select =" normalize-space( translate($date-time,'TZ ',''))" /> < xsl:variable name ="year" select =" translate( substring($compact,1, 4+(starts-with($compact,'+') or starts-with($compact,'-'))), '+','')"/> < xsl:variable name ="date" select ="substring-after($compact,$year)" /> < xsl:variable name ="time" select ="substring($date,7)" /> < xsl:variable name ="month" select ="format-number(substring($date,2,2)-1,0)" /> < xsl:variable name ="utc-offset" > < xsl:variable name ="raw" select =" concat( substring-after($time,'+'), substring-after($time,'-'))"/> < xsl:variable select =" format-number( (contains($time,'-')-.5) *2*(substring($raw,1,2)*60 +substring($raw,4,2)),0)"/> </ xsl:variable > < xsl:variable select =" format-number( 1000*( 24*3600*( $year*365-719527 +floor($year div 4) -floor($year div 100) +floor($year div 400) +sum($date:month/*[$month>=position()]) +format-number(substring($date,5,2)-1,0) -(2>$month and (($year mod 4=0 and $year mod 100!=0) or $year mod 400=0))) +format-number( concat(0,substring($time,7, (substring($time,6,1)=':')*2)) +substring($time,1,2)*3600 +substring($time,4,2)*60,0) +$utc-offset*60) +format-number( round( (substring($time,9,1)='.') *1000*substring-before( translate( concat('0.',substring-after($time,'.'),'_'), '+-','__'),'_')),0),0)"/> </ xsl:template >
< xsl:template name ="date:timestamp" > < xsl:param name ="date-time" /> < xsl:variable name ="compact" select =" normalize-space( translate($date-time,'TZ ',''))" /> < xsl:variable name ="year" select =" translate( substring($compact,1, 4+(starts-with($compact,'+') or starts-with($compact,'-'))), '+','')"/> < xsl:variable name ="date" select ="substring-after($compact,$year)" /> < xsl:variable name ="time" select ="substring($date,7)" /> < xsl:variable name ="month" select ="format-number(substring($date,2,2)-1,0)" /> < xsl:variable name ="utc-offset" > < xsl:variable name ="raw" select =" concat( substring-after($time,'+'), substring-after($time,'-'))"/> < xsl:variable select =" format-number( (contains($time,'-')-.5) *2*(substring($raw,1,2)*60 +substring($raw,4,2)),0)"/> </ xsl:variable > < xsl:variable select =" format-number( 1000*( 24*3600*( $year*365-719527 +floor($year div 4) -floor($year div 100) +floor($year div 400) +sum($date:month/*[$month>=position()]) +format-number(substring($date,5,2)-1,0) -(2>$month and (($year mod 4=0 and $year mod 100!=0) or $year mod 400=0))) +format-number( concat(0,substring($time,7, (substring($time,6,1)=':')*2)) +substring($time,1,2)*3600 +substring($time,4,2)*60,0) +$utc-offset*60) +format-number( round( (substring($time,9,1)='.') *1000*substring-before( translate( concat('0.',substring-after($time,'.'),'_'), '+-','__'),'_')),0),0)"/> </ xsl:template >
< xsl:template name ="date:timestamp" > < xsl:param name ="date-time" /> < xsl:variable name ="compact" select =" normalize-space( translate($date-time,'TZ ',''))" /> < xsl:variable name ="year" select =" translate( substring($compact,1, 4+(starts-with($compact,'+') or starts-with($compact,'-'))), '+','')"/> < xsl:variable name ="date" select ="substring-after($compact,$year)" /> < xsl:variable name ="time" select ="substring($date,7)" /> < xsl:variable name ="month" select ="format-number(substring($date,2,2)-1,0)" /> < xsl:variable name ="utc-offset" > < xsl:variable name ="raw" select =" concat( substring-after($time,'+'), substring-after($time,'-'))"/> < xsl:variable select =" format-number( (contains($time,'-')-.5) *2*(substring($raw,1,2)*60 +substring($raw,4,2)),0)"/> </ xsl:variable > < xsl:variable select =" format-number( 1000*( 24*3600*( $year*365-719527 +floor($year div 4) -floor($year div 100) +floor($year div 400) +sum($date:month/*[$month>=position()]) +format-number(substring($date,5,2)-1,0) -(2>$month and (($year mod 4=0 and $year mod 100!=0) or $year mod 400=0))) +format-number( concat(0,substring($time,7, (substring($time,6,1)=':')*2)) +substring($time,1,2)*3600 +substring($time,4,2)*60,0) +$utc-offset*60) +format-number( round( (substring($time,9,1)='.') *1000*substring-before( translate( concat('0.',substring-after($time,'.'),'_'), '+-','__'),'_')),0),0)"/> </ xsl:template >
< xsl:template name ="date:timestamp" > < xsl:param name ="date-time" /> < xsl:variable name ="compact" select =" normalize-space( translate($date-time,'TZ ',''))" /> < xsl:variable name ="year" select =" translate( substring($compact,1, 4+(starts-with($compact,'+') or starts-with($compact,'-'))), '+','')"/> < xsl:variable name ="date" select ="substring-after($compact,$year)" /> < xsl:variable name ="time" select ="substring($date,7)" /> < xsl:variable name ="month" select ="format-number(substring($date,2,2)-1,0)" /> < xsl:variable name ="utc-offset" > < xsl:variable name ="raw" select =" concat( substring-after($time,'+'), substring-after($time,'-'))"/> < xsl:variable select =" format-number( (contains($time,'-')-.5) *2*(substring($raw,1,2)*60 +substring($raw,4,2)),0)"/> </ xsl:variable > < xsl:variable select =" format-number( 1000*( 24*3600*( $year*365-719527 +floor($year div 4) -floor($year div 100) +floor($year div 400) +sum($date:month/*[$month>=position()]) +format-number(substring($date,5,2)-1,0) -(2>$month and (($year mod 4=0 and $year mod 100!=0) or $year mod 400=0))) +format-number( concat(0,substring($time,7, (substring($time,6,1)=':')*2)) +substring($time,1,2)*3600 +substring($time,4,2)*60,0) +$utc-offset*60) +format-number( round( (substring($time,9,1)='.') *1000*substring-before( translate( concat('0.',substring-after($time,'.'),'_'), '+-','__'),'_')),0),0)"/> </ xsl:template >
< xsl:template name ="date:timestamp" > < xsl:param name ="date-time" /> < xsl:variable name ="compact" select =" normalize-space( translate($date-time,'TZ ',''))" /> < xsl:variable name ="year" select =" translate( substring($compact,1, 4+(starts-with($compact,'+') or starts-with($compact,'-'))), '+','')"/> < xsl:variable name ="date" select ="substring-after($compact,$year)" /> < xsl:variable name ="time" select ="substring($date,7)" /> < xsl:variable name ="month" select ="format-number(substring($date,2,2)-1,0)" /> < xsl:variable name ="utc-offset" > < xsl:variable name ="raw" select =" concat( substring-after($time,'+'), substring-after($time,'-'))"/> < xsl:variable select =" format-number( (contains($time,'-')-.5) *2*(substring($raw,1,2)*60 +substring($raw,4,2)),0)"/> </ xsl:variable > < xsl:variable select =" format-number( 1000*( 24*3600*( $year*365-719527 +floor($year div 4) -floor($year div 100) +floor($year div 400) +sum($date:month/*[$month>=position()]) +format-number(substring($date,5,2)-1,0) -(2>$month and (($year mod 4=0 and $year mod 100!=0) or $year mod 400=0))) +format-number( concat(0,substring($time,7, (substring($time,6,1)=':')*2)) +substring($time,1,2)*3600 +substring($time,4,2)*60,0) +$utc-offset*60) +format-number( round( (substring($time,9,1)='.') *1000*substring-before( translate( concat('0.',substring-after($time,'.'),'_'), '+-','__'),'_')),0),0)"/> </ xsl:template >
< xsl:template name ="date:timestamp" > < xsl:param name ="date-time" /> < xsl:variable name ="compact" select =" normalize-space( translate($date-time,'TZ ',''))" /> < xsl:variable name ="year" select =" translate( substring($compact,1, 4+(starts-with($compact,'+') or starts-with($compact,'-'))), '+','')"/> < xsl:variable name ="date" select ="substring-after($compact,$year)" /> < xsl:variable name ="time" select ="substring($date,7)" /> < xsl:variable name ="month" select ="format-number(substring($date,2,2)-1,0)" /> < xsl:variable name ="utc-offset" > < xsl:variable name ="raw" select =" concat( substring-after($time,'+'), substring-after($time,'-'))"/> < xsl:variable select =" format-number( (contains($time,'-')-.5) *2*(substring($raw,1,2)*60 +substring($raw,4,2)),0)"/> </ xsl:variable > < xsl:variable select =" format-number( 1000*( 24*3600*( $year*365-719527 +floor($year div 4) -floor($year div 100) +floor($year div 400) +sum($date:month/*[$month>=position()]) +format-number(substring($date,5,2)-1,0) -(2>$month and (($year mod 4=0 and $year mod 100!=0) or $year mod 400=0))) +format-number( concat(0,substring($time,7, (substring($time,6,1)=':')*2)) +substring($time,1,2)*3600 +substring($time,4,2)*60,0) +$utc-offset*60) +format-number( round( (substring($time,9,1)='.') *1000*substring-before( translate( concat('0.',substring-after($time,'.'),'_'), '+-','__'),'_')),0),0)"/> </ xsl:template >
< xsl:template name ="date:timestamp" > < xsl:param name ="date-time" /> < xsl:variable name ="compact" select =" normalize-space( translate($date-time,'TZ ',''))" /> < xsl:variable name ="year" select =" translate( substring($compact,1, 4+(starts-with($compact,'+') or starts-with($compact,'-'))), '+','')"/> < xsl:variable name ="date" select ="substring-after($compact,$year)" /> < xsl:variable name ="time" select ="substring($date,7)" /> < xsl:variable name ="month" select ="format-number(substring($date,2,2)-1,0)" /> < xsl:variable name ="utc-offset" > < xsl:variable name ="raw" select =" concat( substring-after($time,'+'), substring-after($time,'-'))"/> < xsl:variable select =" format-number( (contains($time,'-')-.5) *2*(substring($raw,1,2)*60 +substring($raw,4,2)),0)"/> </ xsl:variable > < xsl:variable select =" format-number( 1000*( 24*3600*( $year*365-719527 +floor($year div 4) -floor($year div 100) +floor($year div 400) +sum($date:month/*[$month>=position()]) +format-number(substring($date,5,2)-1,0) -(2>$month and (($year mod 4=0 and $year mod 100!=0) or $year mod 400=0))) +format-number( concat(0,substring($time,7, (substring($time,6,1)=':')*2)) +substring($time,1,2)*3600 +substring($time,4,2)*60,0) +$utc-offset*60) +format-number( round( (substring($time,9,1)='.') *1000*substring-before( translate( concat('0.',substring-after($time,'.'),'_'), '+-','__'),'_')),0),0)"/> </ xsl:template >
< xsl:template name ="date:timestamp" > < xsl:param name ="date-time" /> < xsl:variable name ="compact" select =" normalize-space( translate($date-time,'TZ ',''))" /> < xsl:variable name ="year" select =" translate( substring($compact,1, 4+(starts-with($compact,'+') or starts-with($compact,'-'))), '+','')"/> < xsl:variable name ="date" select ="substring-after($compact,$year)" /> < xsl:variable name ="time" select ="substring($date,7)" /> < xsl:variable name ="month" select ="format-number(substring($date,2,2)-1,0)" /> < xsl:variable name ="utc-offset" > < xsl:variable name ="raw" select =" concat( substring-after($time,'+'), substring-after($time,'-'))"/> < xsl:variable select =" format-number( (contains($time,'-')-.5) *2*(substring($raw,1,2)*60 +substring($raw,4,2)),0)"/> </ xsl:variable > < xsl:variable select =" format-number( 1000*( 24*3600*( $year*365-719527 +floor($year div 4) -floor($year div 100) +floor($year div 400) +sum($date:month/*[$month>=position()]) +format-number(substring($date,5,2)-1,0) -(2>$month and (($year mod 4=0 and $year mod 100!=0) or $year mod 400=0))) +format-number( concat(0,substring($time,7, (substring($time,6,1)=':')*2)) +substring($time,1,2)*3600 +substring($time,4,2)*60,0) +$utc-offset*60) +format-number( round( (substring($time,9,1)='.') *1000*substring-before( translate( concat('0.',substring-after($time,'.'),'_'), '+-','__'),'_')),0),0)"/> </ xsl:template >
< xsl:template name ="date:timestamp" > < xsl:param name ="date-time" /> < xsl:variable name ="compact" select =" normalize-space( translate($date-time,'TZ ',''))" /> < xsl:variable name ="year" select =" translate( substring($compact,1, 4+(starts-with($compact,'+') or starts-with($compact,'-'))), '+','')"/> < xsl:variable name ="date" select ="substring-after($compact,$year)" /> < xsl:variable name ="time" select ="substring($date,7)" /> < xsl:variable name ="month" select ="format-number(substring($date,2,2)-1,0)" /> < xsl:variable name ="utc-offset" > < xsl:variable name ="raw" select =" concat( substring-after($time,'+'), substring-after($time,'-'))"/> < xsl:variable select =" format-number( (contains($time,'-')-.5) *2*(substring($raw,1,2)*60 +substring($raw,4,2)),0)"/> </ xsl:variable > < xsl:variable select =" format-number( 1000*( 24*3600*( $year*365-719527 +floor($year div 4) -floor($year div 100) +floor($year div 400) +sum($date:month/*[$month>=position()]) +format-number(substring($date,5,2)-1,0) -(2>$month and (($year mod 4=0 and $year mod 100!=0) or $year mod 400=0))) +format-number( concat(0,substring($time,7, (substring($time,6,1)=':')*2)) +substring($time,1,2)*3600 +substring($time,4,2)*60,0) +$utc-offset*60) +format-number( round( (substring($time,9,1)='.') *1000*substring-before( translate( concat('0.',substring-after($time,'.'),'_'), '+-','__'),'_')),0),0)"/> </ xsl:template >
< xsl:template name ="date:timestamp" > < xsl:param name ="date-time" /> < xsl:variable name ="compact" select =" normalize-space( translate($date-time,'TZ ',''))" /> < xsl:variable name ="year" select =" translate( substring($compact,1, 4+(starts-with($compact,'+') or starts-with($compact,'-'))), '+','')"/> < xsl:variable name ="date" select ="substring-after($compact,$year)" /> < xsl:variable name ="time" select ="substring($date,7)" /> < xsl:variable name ="month" select ="format-number(substring($date,2,2)-1,0)" /> < xsl:variable name ="utc-offset" > < xsl:variable name ="raw" select =" concat( substring-after($time,'+'), substring-after($time,'-'))"/> < xsl:variable select =" format-number( (contains($time,'-')-.5) *2*(substring($raw,1,2)*60 +substring($raw,4,2)),0)"/> </ xsl:variable > < xsl:variable select =" format-number( 1000*( 24*3600*( $year*365-719527 +floor($year div 4) -floor($year div 100) +floor($year div 400) +sum($date:month/*[$month>=position()]) +format-number(substring($date,5,2)-1,0) -(2>$month and (($year mod 4=0 and $year mod 100!=0) or $year mod 400=0))) +format-number( concat(0,substring($time,7, (substring($time,6,1)=':')*2)) +substring($time,1,2)*3600 +substring($time,4,2)*60,0) +$utc-offset*60) +format-number( round( (substring($time,9,1)='.') *1000*substring-before( translate( concat('0.',substring-after($time,'.'),'_'), '+-','__'),'_')),0),0)"/> </ xsl:template >
< xsl:template name ="date:timestamp" > < xsl:param name ="date-time" /> < xsl:variable name ="compact" select =" normalize-space( translate($date-time,'TZ ',''))" /> < xsl:variable name ="year" select =" translate( substring($compact,1, 4+(starts-with($compact,'+') or starts-with($compact,'-'))), '+','')"/> < xsl:variable name ="date" select ="substring-after($compact,$year)" /> < xsl:variable name ="time" select ="substring($date,7)" /> < xsl:variable name ="month" select ="format-number(substring($date,2,2)-1,0)" /> < xsl:variable name ="utc-offset" > < xsl:variable name ="raw" select =" concat( substring-after($time,'+'), substring-after($time,'-'))"/> < xsl:variable select =" format-number( (contains($time,'-')-.5) *2*(substring($raw,1,2)*60 +substring($raw,4,2)),0)"/> </ xsl:variable > < xsl:variable select =" format-number( 1000*( 24*3600*( $year*365-719527 +floor($year div 4) -floor($year div 100) +floor($year div 400) +sum($date:month/*[$month>=position()]) +format-number(substring($date,5,2)-1,0) -(2>$month and (($year mod 4=0 and $year mod 100!=0) or $year mod 400=0))) +format-number( concat(0,substring($time,7, (substring($time,6,1)=':')*2)) +substring($time,1,2)*3600 +substring($time,4,2)*60,0) +$utc-offset*60) +format-number( round( (substring($time,9,1)='.') *1000*substring-before( translate( concat('0.',substring-after($time,'.'),'_'), '+-','__'),'_')),0),0)"/> </ xsl:template >
< xsl:template name ="date:timestamp" > < xsl:param name ="date-time" /> < xsl:variable name ="compact" select =" normalize-space( translate($date-time,'TZ ',''))" /> < xsl:variable name ="year" select =" translate( substring($compact,1, 4+(starts-with($compact,'+') or starts-with($compact,'-'))), '+','')"/> < xsl:variable name ="date" select ="substring-after($compact,$year)" /> < xsl:variable name ="time" select ="substring($date,7)" /> < xsl:variable name ="month" select ="format-number(substring($date,2,2)-1,0)" /> < xsl:variable name ="utc-offset" > < xsl:variable name ="raw" select =" concat( substring-after($time,'+'), substring-after($time,'-'))"/> < xsl:variable select =" format-number( (contains($time,'-')-.5) *2*(substring($raw,1,2)*60 +substring($raw,4,2)),0)"/> </ xsl:variable > < xsl:variable select =" format-number( 1000*( 24*3600*( $year*365-719527 +floor($year div 4) -floor($year div 100) +floor($year div 400) +sum($date:month/*[$month>=position()]) +format-number(substring($date,5,2)-1,0) -(2>$month and (($year mod 4=0 and $year mod 100!=0) or $year mod 400=0))) +format-number( concat(0,substring($time,7, (substring($time,6,1)=':')*2)) +substring($time,1,2)*3600 +substring($time,4,2)*60,0) +$utc-offset*60) +format-number( round( (substring($time,9,1)='.') *1000*substring-before( translate( concat('0.',substring-after($time,'.'),'_'), '+-','__'),'_')),0),0)"/> </ xsl:template >
計算の詳細については説明しませんが、その機能についてのみ説明します。
@paramは、フォーマットされた文字列が渡される単一のパラメーター
$date-time
受け入れます。 行内のスペースの存在と数は重要ではありません-それらはすべてブロードキャストされます。 日付区切り文字には、スペースを除く任意の1文字を使用できます。
パラメーターの一般化されたパターンは次のとおりです。
yyyy
年
MM
月
dd
日
T
日付識別子
hh
見る
mm
分
S
秒の小数部。任意の桁数を含むことができます(1桁ではない場合も含む)
Z
-UTCタイムゾーン識別子
[]
-括弧の内容は存在する場合と存在しない場合があります。
()
-括弧の内容が存在する必要があります。
|
-または
@output Unix時代1970-01-01T00の始まりからのミリ秒数を返します:00:00Z。
日時のタイムスタンプ
このリストは、数値からRFC形式の文字列への逆変換です。
< xsl:template name ="date:date-time" > < xsl:param name ="timestamp" /> < xsl:if test ="not(format-number($timestamp,0)='NaN')" > < xsl:variable name ="days" select ="$timestamp div (24*3600000)" /> < xsl:variable name ="time" select =" $timestamp div 1000 -floor($days)*24*3600" /> < xsl:variable name ="year" select =" 1970+floor( format-number($days div 365.24,'0.#'))" /> < xsl:variable name ="year-offset" select =" 719528-$year*365 -floor($year div 4) +floor($year div 100) -floor($year div 400) +floor($days)"/> < xsl:variable name ="month" select =" count($date:month /*[$year-offset>=sum(preceding-sibling::*)][last()] /preceding-sibling::*)" /> < xsl:variable name ="hours" select ="floor($time div 3600)" /> < xsl:variable name ="min" select ="floor($time div 60-$hours*60)" /> < xsl:variable name ="sec" select ="floor($time -$hours*3600-$min*60)" /> < xsl:variable select =" concat( format-number($year,'0000'),'-', format-number($month+1,'00'),'-', format-number( $year-offset -sum($date:month/*[$month>=position()]) +(2>$month and (($year mod 4=0 and $year mod 100!=0) or $year mod 400=0)), '00'),'T', format-number($hours,'00'),':', format-number($min,'00'),':', format-number($sec,'00'),'.', format-number( 1000*($time -$hours*3600 -$min*60-$sec), '000'),'Z')" /> </ xsl:if > </ xsl:template >
< xsl:template name ="date:date-time" > < xsl:param name ="timestamp" /> < xsl:if test ="not(format-number($timestamp,0)='NaN')" > < xsl:variable name ="days" select ="$timestamp div (24*3600000)" /> < xsl:variable name ="time" select =" $timestamp div 1000 -floor($days)*24*3600" /> < xsl:variable name ="year" select =" 1970+floor( format-number($days div 365.24,'0.#'))" /> < xsl:variable name ="year-offset" select =" 719528-$year*365 -floor($year div 4) +floor($year div 100) -floor($year div 400) +floor($days)"/> < xsl:variable name ="month" select =" count($date:month /*[$year-offset>=sum(preceding-sibling::*)][last()] /preceding-sibling::*)" /> < xsl:variable name ="hours" select ="floor($time div 3600)" /> < xsl:variable name ="min" select ="floor($time div 60-$hours*60)" /> < xsl:variable name ="sec" select ="floor($time -$hours*3600-$min*60)" /> < xsl:variable select =" concat( format-number($year,'0000'),'-', format-number($month+1,'00'),'-', format-number( $year-offset -sum($date:month/*[$month>=position()]) +(2>$month and (($year mod 4=0 and $year mod 100!=0) or $year mod 400=0)), '00'),'T', format-number($hours,'00'),':', format-number($min,'00'),':', format-number($sec,'00'),'.', format-number( 1000*($time -$hours*3600 -$min*60-$sec), '000'),'Z')" /> </ xsl:if > </ xsl:template >
< xsl:template name ="date:date-time" > < xsl:param name ="timestamp" /> < xsl:if test ="not(format-number($timestamp,0)='NaN')" > < xsl:variable name ="days" select ="$timestamp div (24*3600000)" /> < xsl:variable name ="time" select =" $timestamp div 1000 -floor($days)*24*3600" /> < xsl:variable name ="year" select =" 1970+floor( format-number($days div 365.24,'0.#'))" /> < xsl:variable name ="year-offset" select =" 719528-$year*365 -floor($year div 4) +floor($year div 100) -floor($year div 400) +floor($days)"/> < xsl:variable name ="month" select =" count($date:month /*[$year-offset>=sum(preceding-sibling::*)][last()] /preceding-sibling::*)" /> < xsl:variable name ="hours" select ="floor($time div 3600)" /> < xsl:variable name ="min" select ="floor($time div 60-$hours*60)" /> < xsl:variable name ="sec" select ="floor($time -$hours*3600-$min*60)" /> < xsl:variable select =" concat( format-number($year,'0000'),'-', format-number($month+1,'00'),'-', format-number( $year-offset -sum($date:month/*[$month>=position()]) +(2>$month and (($year mod 4=0 and $year mod 100!=0) or $year mod 400=0)), '00'),'T', format-number($hours,'00'),':', format-number($min,'00'),':', format-number($sec,'00'),'.', format-number( 1000*($time -$hours*3600 -$min*60-$sec), '000'),'Z')" /> </ xsl:if > </ xsl:template >
< xsl:template name ="date:date-time" > < xsl:param name ="timestamp" /> < xsl:if test ="not(format-number($timestamp,0)='NaN')" > < xsl:variable name ="days" select ="$timestamp div (24*3600000)" /> < xsl:variable name ="time" select =" $timestamp div 1000 -floor($days)*24*3600" /> < xsl:variable name ="year" select =" 1970+floor( format-number($days div 365.24,'0.#'))" /> < xsl:variable name ="year-offset" select =" 719528-$year*365 -floor($year div 4) +floor($year div 100) -floor($year div 400) +floor($days)"/> < xsl:variable name ="month" select =" count($date:month /*[$year-offset>=sum(preceding-sibling::*)][last()] /preceding-sibling::*)" /> < xsl:variable name ="hours" select ="floor($time div 3600)" /> < xsl:variable name ="min" select ="floor($time div 60-$hours*60)" /> < xsl:variable name ="sec" select ="floor($time -$hours*3600-$min*60)" /> < xsl:variable select =" concat( format-number($year,'0000'),'-', format-number($month+1,'00'),'-', format-number( $year-offset -sum($date:month/*[$month>=position()]) +(2>$month and (($year mod 4=0 and $year mod 100!=0) or $year mod 400=0)), '00'),'T', format-number($hours,'00'),':', format-number($min,'00'),':', format-number($sec,'00'),'.', format-number( 1000*($time -$hours*3600 -$min*60-$sec), '000'),'Z')" /> </ xsl:if > </ xsl:template >
< xsl:template name ="date:date-time" > < xsl:param name ="timestamp" /> < xsl:if test ="not(format-number($timestamp,0)='NaN')" > < xsl:variable name ="days" select ="$timestamp div (24*3600000)" /> < xsl:variable name ="time" select =" $timestamp div 1000 -floor($days)*24*3600" /> < xsl:variable name ="year" select =" 1970+floor( format-number($days div 365.24,'0.#'))" /> < xsl:variable name ="year-offset" select =" 719528-$year*365 -floor($year div 4) +floor($year div 100) -floor($year div 400) +floor($days)"/> < xsl:variable name ="month" select =" count($date:month /*[$year-offset>=sum(preceding-sibling::*)][last()] /preceding-sibling::*)" /> < xsl:variable name ="hours" select ="floor($time div 3600)" /> < xsl:variable name ="min" select ="floor($time div 60-$hours*60)" /> < xsl:variable name ="sec" select ="floor($time -$hours*3600-$min*60)" /> < xsl:variable select =" concat( format-number($year,'0000'),'-', format-number($month+1,'00'),'-', format-number( $year-offset -sum($date:month/*[$month>=position()]) +(2>$month and (($year mod 4=0 and $year mod 100!=0) or $year mod 400=0)), '00'),'T', format-number($hours,'00'),':', format-number($min,'00'),':', format-number($sec,'00'),'.', format-number( 1000*($time -$hours*3600 -$min*60-$sec), '000'),'Z')" /> </ xsl:if > </ xsl:template >
< xsl:template name ="date:date-time" > < xsl:param name ="timestamp" /> < xsl:if test ="not(format-number($timestamp,0)='NaN')" > < xsl:variable name ="days" select ="$timestamp div (24*3600000)" /> < xsl:variable name ="time" select =" $timestamp div 1000 -floor($days)*24*3600" /> < xsl:variable name ="year" select =" 1970+floor( format-number($days div 365.24,'0.#'))" /> < xsl:variable name ="year-offset" select =" 719528-$year*365 -floor($year div 4) +floor($year div 100) -floor($year div 400) +floor($days)"/> < xsl:variable name ="month" select =" count($date:month /*[$year-offset>=sum(preceding-sibling::*)][last()] /preceding-sibling::*)" /> < xsl:variable name ="hours" select ="floor($time div 3600)" /> < xsl:variable name ="min" select ="floor($time div 60-$hours*60)" /> < xsl:variable name ="sec" select ="floor($time -$hours*3600-$min*60)" /> < xsl:variable select =" concat( format-number($year,'0000'),'-', format-number($month+1,'00'),'-', format-number( $year-offset -sum($date:month/*[$month>=position()]) +(2>$month and (($year mod 4=0 and $year mod 100!=0) or $year mod 400=0)), '00'),'T', format-number($hours,'00'),':', format-number($min,'00'),':', format-number($sec,'00'),'.', format-number( 1000*($time -$hours*3600 -$min*60-$sec), '000'),'Z')" /> </ xsl:if > </ xsl:template >
< xsl:template name ="date:date-time" > < xsl:param name ="timestamp" /> < xsl:if test ="not(format-number($timestamp,0)='NaN')" > < xsl:variable name ="days" select ="$timestamp div (24*3600000)" /> < xsl:variable name ="time" select =" $timestamp div 1000 -floor($days)*24*3600" /> < xsl:variable name ="year" select =" 1970+floor( format-number($days div 365.24,'0.#'))" /> < xsl:variable name ="year-offset" select =" 719528-$year*365 -floor($year div 4) +floor($year div 100) -floor($year div 400) +floor($days)"/> < xsl:variable name ="month" select =" count($date:month /*[$year-offset>=sum(preceding-sibling::*)][last()] /preceding-sibling::*)" /> < xsl:variable name ="hours" select ="floor($time div 3600)" /> < xsl:variable name ="min" select ="floor($time div 60-$hours*60)" /> < xsl:variable name ="sec" select ="floor($time -$hours*3600-$min*60)" /> < xsl:variable select =" concat( format-number($year,'0000'),'-', format-number($month+1,'00'),'-', format-number( $year-offset -sum($date:month/*[$month>=position()]) +(2>$month and (($year mod 4=0 and $year mod 100!=0) or $year mod 400=0)), '00'),'T', format-number($hours,'00'),':', format-number($min,'00'),':', format-number($sec,'00'),'.', format-number( 1000*($time -$hours*3600 -$min*60-$sec), '000'),'Z')" /> </ xsl:if > </ xsl:template >
< xsl:template name ="date:date-time" > < xsl:param name ="timestamp" /> < xsl:if test ="not(format-number($timestamp,0)='NaN')" > < xsl:variable name ="days" select ="$timestamp div (24*3600000)" /> < xsl:variable name ="time" select =" $timestamp div 1000 -floor($days)*24*3600" /> < xsl:variable name ="year" select =" 1970+floor( format-number($days div 365.24,'0.#'))" /> < xsl:variable name ="year-offset" select =" 719528-$year*365 -floor($year div 4) +floor($year div 100) -floor($year div 400) +floor($days)"/> < xsl:variable name ="month" select =" count($date:month /*[$year-offset>=sum(preceding-sibling::*)][last()] /preceding-sibling::*)" /> < xsl:variable name ="hours" select ="floor($time div 3600)" /> < xsl:variable name ="min" select ="floor($time div 60-$hours*60)" /> < xsl:variable name ="sec" select ="floor($time -$hours*3600-$min*60)" /> < xsl:variable select =" concat( format-number($year,'0000'),'-', format-number($month+1,'00'),'-', format-number( $year-offset -sum($date:month/*[$month>=position()]) +(2>$month and (($year mod 4=0 and $year mod 100!=0) or $year mod 400=0)), '00'),'T', format-number($hours,'00'),':', format-number($min,'00'),':', format-number($sec,'00'),'.', format-number( 1000*($time -$hours*3600 -$min*60-$sec), '000'),'Z')" /> </ xsl:if > </ xsl:template >
< xsl:template name ="date:date-time" > < xsl:param name ="timestamp" /> < xsl:if test ="not(format-number($timestamp,0)='NaN')" > < xsl:variable name ="days" select ="$timestamp div (24*3600000)" /> < xsl:variable name ="time" select =" $timestamp div 1000 -floor($days)*24*3600" /> < xsl:variable name ="year" select =" 1970+floor( format-number($days div 365.24,'0.#'))" /> < xsl:variable name ="year-offset" select =" 719528-$year*365 -floor($year div 4) +floor($year div 100) -floor($year div 400) +floor($days)"/> < xsl:variable name ="month" select =" count($date:month /*[$year-offset>=sum(preceding-sibling::*)][last()] /preceding-sibling::*)" /> < xsl:variable name ="hours" select ="floor($time div 3600)" /> < xsl:variable name ="min" select ="floor($time div 60-$hours*60)" /> < xsl:variable name ="sec" select ="floor($time -$hours*3600-$min*60)" /> < xsl:variable select =" concat( format-number($year,'0000'),'-', format-number($month+1,'00'),'-', format-number( $year-offset -sum($date:month/*[$month>=position()]) +(2>$month and (($year mod 4=0 and $year mod 100!=0) or $year mod 400=0)), '00'),'T', format-number($hours,'00'),':', format-number($min,'00'),':', format-number($sec,'00'),'.', format-number( 1000*($time -$hours*3600 -$min*60-$sec), '000'),'Z')" /> </ xsl:if > </ xsl:template >
< xsl:template name ="date:date-time" > < xsl:param name ="timestamp" /> < xsl:if test ="not(format-number($timestamp,0)='NaN')" > < xsl:variable name ="days" select ="$timestamp div (24*3600000)" /> < xsl:variable name ="time" select =" $timestamp div 1000 -floor($days)*24*3600" /> < xsl:variable name ="year" select =" 1970+floor( format-number($days div 365.24,'0.#'))" /> < xsl:variable name ="year-offset" select =" 719528-$year*365 -floor($year div 4) +floor($year div 100) -floor($year div 400) +floor($days)"/> < xsl:variable name ="month" select =" count($date:month /*[$year-offset>=sum(preceding-sibling::*)][last()] /preceding-sibling::*)" /> < xsl:variable name ="hours" select ="floor($time div 3600)" /> < xsl:variable name ="min" select ="floor($time div 60-$hours*60)" /> < xsl:variable name ="sec" select ="floor($time -$hours*3600-$min*60)" /> < xsl:variable select =" concat( format-number($year,'0000'),'-', format-number($month+1,'00'),'-', format-number( $year-offset -sum($date:month/*[$month>=position()]) +(2>$month and (($year mod 4=0 and $year mod 100!=0) or $year mod 400=0)), '00'),'T', format-number($hours,'00'),':', format-number($min,'00'),':', format-number($sec,'00'),'.', format-number( 1000*($time -$hours*3600 -$min*60-$sec), '000'),'Z')" /> </ xsl:if > </ xsl:template >
< xsl:template name ="date:date-time" > < xsl:param name ="timestamp" /> < xsl:if test ="not(format-number($timestamp,0)='NaN')" > < xsl:variable name ="days" select ="$timestamp div (24*3600000)" /> < xsl:variable name ="time" select =" $timestamp div 1000 -floor($days)*24*3600" /> < xsl:variable name ="year" select =" 1970+floor( format-number($days div 365.24,'0.#'))" /> < xsl:variable name ="year-offset" select =" 719528-$year*365 -floor($year div 4) +floor($year div 100) -floor($year div 400) +floor($days)"/> < xsl:variable name ="month" select =" count($date:month /*[$year-offset>=sum(preceding-sibling::*)][last()] /preceding-sibling::*)" /> < xsl:variable name ="hours" select ="floor($time div 3600)" /> < xsl:variable name ="min" select ="floor($time div 60-$hours*60)" /> < xsl:variable name ="sec" select ="floor($time -$hours*3600-$min*60)" /> < xsl:variable select =" concat( format-number($year,'0000'),'-', format-number($month+1,'00'),'-', format-number( $year-offset -sum($date:month/*[$month>=position()]) +(2>$month and (($year mod 4=0 and $year mod 100!=0) or $year mod 400=0)), '00'),'T', format-number($hours,'00'),':', format-number($min,'00'),':', format-number($sec,'00'),'.', format-number( 1000*($time -$hours*3600 -$min*60-$sec), '000'),'Z')" /> </ xsl:if > </ xsl:template >
< xsl:template name ="date:date-time" > < xsl:param name ="timestamp" /> < xsl:if test ="not(format-number($timestamp,0)='NaN')" > < xsl:variable name ="days" select ="$timestamp div (24*3600000)" /> < xsl:variable name ="time" select =" $timestamp div 1000 -floor($days)*24*3600" /> < xsl:variable name ="year" select =" 1970+floor( format-number($days div 365.24,'0.#'))" /> < xsl:variable name ="year-offset" select =" 719528-$year*365 -floor($year div 4) +floor($year div 100) -floor($year div 400) +floor($days)"/> < xsl:variable name ="month" select =" count($date:month /*[$year-offset>=sum(preceding-sibling::*)][last()] /preceding-sibling::*)" /> < xsl:variable name ="hours" select ="floor($time div 3600)" /> < xsl:variable name ="min" select ="floor($time div 60-$hours*60)" /> < xsl:variable name ="sec" select ="floor($time -$hours*3600-$min*60)" /> < xsl:variable select =" concat( format-number($year,'0000'),'-', format-number($month+1,'00'),'-', format-number( $year-offset -sum($date:month/*[$month>=position()]) +(2>$month and (($year mod 4=0 and $year mod 100!=0) or $year mod 400=0)), '00'),'T', format-number($hours,'00'),':', format-number($min,'00'),':', format-number($sec,'00'),'.', format-number( 1000*($time -$hours*3600 -$min*60-$sec), '000'),'Z')" /> </ xsl:if > </ xsl:template >
< xsl:template name ="date:date-time" > < xsl:param name ="timestamp" /> < xsl:if test ="not(format-number($timestamp,0)='NaN')" > < xsl:variable name ="days" select ="$timestamp div (24*3600000)" /> < xsl:variable name ="time" select =" $timestamp div 1000 -floor($days)*24*3600" /> < xsl:variable name ="year" select =" 1970+floor( format-number($days div 365.24,'0.#'))" /> < xsl:variable name ="year-offset" select =" 719528-$year*365 -floor($year div 4) +floor($year div 100) -floor($year div 400) +floor($days)"/> < xsl:variable name ="month" select =" count($date:month /*[$year-offset>=sum(preceding-sibling::*)][last()] /preceding-sibling::*)" /> < xsl:variable name ="hours" select ="floor($time div 3600)" /> < xsl:variable name ="min" select ="floor($time div 60-$hours*60)" /> < xsl:variable name ="sec" select ="floor($time -$hours*3600-$min*60)" /> < xsl:variable select =" concat( format-number($year,'0000'),'-', format-number($month+1,'00'),'-', format-number( $year-offset -sum($date:month/*[$month>=position()]) +(2>$month and (($year mod 4=0 and $year mod 100!=0) or $year mod 400=0)), '00'),'T', format-number($hours,'00'),':', format-number($min,'00'),':', format-number($sec,'00'),'.', format-number( 1000*($time -$hours*3600 -$min*60-$sec), '000'),'Z')" /> </ xsl:if > </ xsl:template >
< xsl:template name ="date:date-time" > < xsl:param name ="timestamp" /> < xsl:if test ="not(format-number($timestamp,0)='NaN')" > < xsl:variable name ="days" select ="$timestamp div (24*3600000)" /> < xsl:variable name ="time" select =" $timestamp div 1000 -floor($days)*24*3600" /> < xsl:variable name ="year" select =" 1970+floor( format-number($days div 365.24,'0.#'))" /> < xsl:variable name ="year-offset" select =" 719528-$year*365 -floor($year div 4) +floor($year div 100) -floor($year div 400) +floor($days)"/> < xsl:variable name ="month" select =" count($date:month /*[$year-offset>=sum(preceding-sibling::*)][last()] /preceding-sibling::*)" /> < xsl:variable name ="hours" select ="floor($time div 3600)" /> < xsl:variable name ="min" select ="floor($time div 60-$hours*60)" /> < xsl:variable name ="sec" select ="floor($time -$hours*3600-$min*60)" /> < xsl:variable select =" concat( format-number($year,'0000'),'-', format-number($month+1,'00'),'-', format-number( $year-offset -sum($date:month/*[$month>=position()]) +(2>$month and (($year mod 4=0 and $year mod 100!=0) or $year mod 400=0)), '00'),'T', format-number($hours,'00'),':', format-number($min,'00'),':', format-number($sec,'00'),'.', format-number( 1000*($time -$hours*3600 -$min*60-$sec), '000'),'Z')" /> </ xsl:if > </ xsl:template >
< xsl:template name ="date:date-time" > < xsl:param name ="timestamp" /> < xsl:if test ="not(format-number($timestamp,0)='NaN')" > < xsl:variable name ="days" select ="$timestamp div (24*3600000)" /> < xsl:variable name ="time" select =" $timestamp div 1000 -floor($days)*24*3600" /> < xsl:variable name ="year" select =" 1970+floor( format-number($days div 365.24,'0.#'))" /> < xsl:variable name ="year-offset" select =" 719528-$year*365 -floor($year div 4) +floor($year div 100) -floor($year div 400) +floor($days)"/> < xsl:variable name ="month" select =" count($date:month /*[$year-offset>=sum(preceding-sibling::*)][last()] /preceding-sibling::*)" /> < xsl:variable name ="hours" select ="floor($time div 3600)" /> < xsl:variable name ="min" select ="floor($time div 60-$hours*60)" /> < xsl:variable name ="sec" select ="floor($time -$hours*3600-$min*60)" /> < xsl:variable select =" concat( format-number($year,'0000'),'-', format-number($month+1,'00'),'-', format-number( $year-offset -sum($date:month/*[$month>=position()]) +(2>$month and (($year mod 4=0 and $year mod 100!=0) or $year mod 400=0)), '00'),'T', format-number($hours,'00'),':', format-number($min,'00'),':', format-number($sec,'00'),'.', format-number( 1000*($time -$hours*3600 -$min*60-$sec), '000'),'Z')" /> </ xsl:if > </ xsl:template >
< xsl:template name ="date:date-time" > < xsl:param name ="timestamp" /> < xsl:if test ="not(format-number($timestamp,0)='NaN')" > < xsl:variable name ="days" select ="$timestamp div (24*3600000)" /> < xsl:variable name ="time" select =" $timestamp div 1000 -floor($days)*24*3600" /> < xsl:variable name ="year" select =" 1970+floor( format-number($days div 365.24,'0.#'))" /> < xsl:variable name ="year-offset" select =" 719528-$year*365 -floor($year div 4) +floor($year div 100) -floor($year div 400) +floor($days)"/> < xsl:variable name ="month" select =" count($date:month /*[$year-offset>=sum(preceding-sibling::*)][last()] /preceding-sibling::*)" /> < xsl:variable name ="hours" select ="floor($time div 3600)" /> < xsl:variable name ="min" select ="floor($time div 60-$hours*60)" /> < xsl:variable name ="sec" select ="floor($time -$hours*3600-$min*60)" /> < xsl:variable select =" concat( format-number($year,'0000'),'-', format-number($month+1,'00'),'-', format-number( $year-offset -sum($date:month/*[$month>=position()]) +(2>$month and (($year mod 4=0 and $year mod 100!=0) or $year mod 400=0)), '00'),'T', format-number($hours,'00'),':', format-number($min,'00'),':', format-number($sec,'00'),'.', format-number( 1000*($time -$hours*3600 -$min*60-$sec), '000'),'Z')" /> </ xsl:if > </ xsl:template >
< xsl:template name ="date:date-time" > < xsl:param name ="timestamp" /> < xsl:if test ="not(format-number($timestamp,0)='NaN')" > < xsl:variable name ="days" select ="$timestamp div (24*3600000)" /> < xsl:variable name ="time" select =" $timestamp div 1000 -floor($days)*24*3600" /> < xsl:variable name ="year" select =" 1970+floor( format-number($days div 365.24,'0.#'))" /> < xsl:variable name ="year-offset" select =" 719528-$year*365 -floor($year div 4) +floor($year div 100) -floor($year div 400) +floor($days)"/> < xsl:variable name ="month" select =" count($date:month /*[$year-offset>=sum(preceding-sibling::*)][last()] /preceding-sibling::*)" /> < xsl:variable name ="hours" select ="floor($time div 3600)" /> < xsl:variable name ="min" select ="floor($time div 60-$hours*60)" /> < xsl:variable name ="sec" select ="floor($time -$hours*3600-$min*60)" /> < xsl:variable select =" concat( format-number($year,'0000'),'-', format-number($month+1,'00'),'-', format-number( $year-offset -sum($date:month/*[$month>=position()]) +(2>$month and (($year mod 4=0 and $year mod 100!=0) or $year mod 400=0)), '00'),'T', format-number($hours,'00'),':', format-number($min,'00'),':', format-number($sec,'00'),'.', format-number( 1000*($time -$hours*3600 -$min*60-$sec), '000'),'Z')" /> </ xsl:if > </ xsl:template >
< xsl:template name ="date:date-time" > < xsl:param name ="timestamp" /> < xsl:if test ="not(format-number($timestamp,0)='NaN')" > < xsl:variable name ="days" select ="$timestamp div (24*3600000)" /> < xsl:variable name ="time" select =" $timestamp div 1000 -floor($days)*24*3600" /> < xsl:variable name ="year" select =" 1970+floor( format-number($days div 365.24,'0.#'))" /> < xsl:variable name ="year-offset" select =" 719528-$year*365 -floor($year div 4) +floor($year div 100) -floor($year div 400) +floor($days)"/> < xsl:variable name ="month" select =" count($date:month /*[$year-offset>=sum(preceding-sibling::*)][last()] /preceding-sibling::*)" /> < xsl:variable name ="hours" select ="floor($time div 3600)" /> < xsl:variable name ="min" select ="floor($time div 60-$hours*60)" /> < xsl:variable name ="sec" select ="floor($time -$hours*3600-$min*60)" /> < xsl:variable select =" concat( format-number($year,'0000'),'-', format-number($month+1,'00'),'-', format-number( $year-offset -sum($date:month/*[$month>=position()]) +(2>$month and (($year mod 4=0 and $year mod 100!=0) or $year mod 400=0)), '00'),'T', format-number($hours,'00'),':', format-number($min,'00'),':', format-number($sec,'00'),'.', format-number( 1000*($time -$hours*3600 -$min*60-$sec), '000'),'Z')" /> </ xsl:if > </ xsl:template >
< xsl:template name ="date:date-time" > < xsl:param name ="timestamp" /> < xsl:if test ="not(format-number($timestamp,0)='NaN')" > < xsl:variable name ="days" select ="$timestamp div (24*3600000)" /> < xsl:variable name ="time" select =" $timestamp div 1000 -floor($days)*24*3600" /> < xsl:variable name ="year" select =" 1970+floor( format-number($days div 365.24,'0.#'))" /> < xsl:variable name ="year-offset" select =" 719528-$year*365 -floor($year div 4) +floor($year div 100) -floor($year div 400) +floor($days)"/> < xsl:variable name ="month" select =" count($date:month /*[$year-offset>=sum(preceding-sibling::*)][last()] /preceding-sibling::*)" /> < xsl:variable name ="hours" select ="floor($time div 3600)" /> < xsl:variable name ="min" select ="floor($time div 60-$hours*60)" /> < xsl:variable name ="sec" select ="floor($time -$hours*3600-$min*60)" /> < xsl:variable select =" concat( format-number($year,'0000'),'-', format-number($month+1,'00'),'-', format-number( $year-offset -sum($date:month/*[$month>=position()]) +(2>$month and (($year mod 4=0 and $year mod 100!=0) or $year mod 400=0)), '00'),'T', format-number($hours,'00'),':', format-number($min,'00'),':', format-number($sec,'00'),'.', format-number( 1000*($time -$hours*3600 -$min*60-$sec), '000'),'Z')" /> </ xsl:if > </ xsl:template >
< xsl:template name ="date:date-time" > < xsl:param name ="timestamp" /> < xsl:if test ="not(format-number($timestamp,0)='NaN')" > < xsl:variable name ="days" select ="$timestamp div (24*3600000)" /> < xsl:variable name ="time" select =" $timestamp div 1000 -floor($days)*24*3600" /> < xsl:variable name ="year" select =" 1970+floor( format-number($days div 365.24,'0.#'))" /> < xsl:variable name ="year-offset" select =" 719528-$year*365 -floor($year div 4) +floor($year div 100) -floor($year div 400) +floor($days)"/> < xsl:variable name ="month" select =" count($date:month /*[$year-offset>=sum(preceding-sibling::*)][last()] /preceding-sibling::*)" /> < xsl:variable name ="hours" select ="floor($time div 3600)" /> < xsl:variable name ="min" select ="floor($time div 60-$hours*60)" /> < xsl:variable name ="sec" select ="floor($time -$hours*3600-$min*60)" /> < xsl:variable select =" concat( format-number($year,'0000'),'-', format-number($month+1,'00'),'-', format-number( $year-offset -sum($date:month/*[$month>=position()]) +(2>$month and (($year mod 4=0 and $year mod 100!=0) or $year mod 400=0)), '00'),'T', format-number($hours,'00'),':', format-number($min,'00'),':', format-number($sec,'00'),'.', format-number( 1000*($time -$hours*3600 -$min*60-$sec), '000'),'Z')" /> </ xsl:if > </ xsl:template >
< xsl:template name ="date:date-time" > < xsl:param name ="timestamp" /> < xsl:if test ="not(format-number($timestamp,0)='NaN')" > < xsl:variable name ="days" select ="$timestamp div (24*3600000)" /> < xsl:variable name ="time" select =" $timestamp div 1000 -floor($days)*24*3600" /> < xsl:variable name ="year" select =" 1970+floor( format-number($days div 365.24,'0.#'))" /> < xsl:variable name ="year-offset" select =" 719528-$year*365 -floor($year div 4) +floor($year div 100) -floor($year div 400) +floor($days)"/> < xsl:variable name ="month" select =" count($date:month /*[$year-offset>=sum(preceding-sibling::*)][last()] /preceding-sibling::*)" /> < xsl:variable name ="hours" select ="floor($time div 3600)" /> < xsl:variable name ="min" select ="floor($time div 60-$hours*60)" /> < xsl:variable name ="sec" select ="floor($time -$hours*3600-$min*60)" /> < xsl:variable select =" concat( format-number($year,'0000'),'-', format-number($month+1,'00'),'-', format-number( $year-offset -sum($date:month/*[$month>=position()]) +(2>$month and (($year mod 4=0 and $year mod 100!=0) or $year mod 400=0)), '00'),'T', format-number($hours,'00'),':', format-number($min,'00'),':', format-number($sec,'00'),'.', format-number( 1000*($time -$hours*3600 -$min*60-$sec), '000'),'Z')" /> </ xsl:if > </ xsl:template >
< xsl:template name ="date:date-time" > < xsl:param name ="timestamp" /> < xsl:if test ="not(format-number($timestamp,0)='NaN')" > < xsl:variable name ="days" select ="$timestamp div (24*3600000)" /> < xsl:variable name ="time" select =" $timestamp div 1000 -floor($days)*24*3600" /> < xsl:variable name ="year" select =" 1970+floor( format-number($days div 365.24,'0.#'))" /> < xsl:variable name ="year-offset" select =" 719528-$year*365 -floor($year div 4) +floor($year div 100) -floor($year div 400) +floor($days)"/> < xsl:variable name ="month" select =" count($date:month /*[$year-offset>=sum(preceding-sibling::*)][last()] /preceding-sibling::*)" /> < xsl:variable name ="hours" select ="floor($time div 3600)" /> < xsl:variable name ="min" select ="floor($time div 60-$hours*60)" /> < xsl:variable name ="sec" select ="floor($time -$hours*3600-$min*60)" /> < xsl:variable select =" concat( format-number($year,'0000'),'-', format-number($month+1,'00'),'-', format-number( $year-offset -sum($date:month/*[$month>=position()]) +(2>$month and (($year mod 4=0 and $year mod 100!=0) or $year mod 400=0)), '00'),'T', format-number($hours,'00'),':', format-number($min,'00'),':', format-number($sec,'00'),'.', format-number( 1000*($time -$hours*3600 -$min*60-$sec), '000'),'Z')" /> </ xsl:if > </ xsl:template >
< xsl:template name ="date:date-time" > < xsl:param name ="timestamp" /> < xsl:if test ="not(format-number($timestamp,0)='NaN')" > < xsl:variable name ="days" select ="$timestamp div (24*3600000)" /> < xsl:variable name ="time" select =" $timestamp div 1000 -floor($days)*24*3600" /> < xsl:variable name ="year" select =" 1970+floor( format-number($days div 365.24,'0.#'))" /> < xsl:variable name ="year-offset" select =" 719528-$year*365 -floor($year div 4) +floor($year div 100) -floor($year div 400) +floor($days)"/> < xsl:variable name ="month" select =" count($date:month /*[$year-offset>=sum(preceding-sibling::*)][last()] /preceding-sibling::*)" /> < xsl:variable name ="hours" select ="floor($time div 3600)" /> < xsl:variable name ="min" select ="floor($time div 60-$hours*60)" /> < xsl:variable name ="sec" select ="floor($time -$hours*3600-$min*60)" /> < xsl:variable select =" concat( format-number($year,'0000'),'-', format-number($month+1,'00'),'-', format-number( $year-offset -sum($date:month/*[$month>=position()]) +(2>$month and (($year mod 4=0 and $year mod 100!=0) or $year mod 400=0)), '00'),'T', format-number($hours,'00'),':', format-number($min,'00'),':', format-number($sec,'00'),'.', format-number( 1000*($time -$hours*3600 -$min*60-$sec), '000'),'Z')" /> </ xsl:if > </ xsl:template >
< xsl:template name ="date:date-time" > < xsl:param name ="timestamp" /> < xsl:if test ="not(format-number($timestamp,0)='NaN')" > < xsl:variable name ="days" select ="$timestamp div (24*3600000)" /> < xsl:variable name ="time" select =" $timestamp div 1000 -floor($days)*24*3600" /> < xsl:variable name ="year" select =" 1970+floor( format-number($days div 365.24,'0.#'))" /> < xsl:variable name ="year-offset" select =" 719528-$year*365 -floor($year div 4) +floor($year div 100) -floor($year div 400) +floor($days)"/> < xsl:variable name ="month" select =" count($date:month /*[$year-offset>=sum(preceding-sibling::*)][last()] /preceding-sibling::*)" /> < xsl:variable name ="hours" select ="floor($time div 3600)" /> < xsl:variable name ="min" select ="floor($time div 60-$hours*60)" /> < xsl:variable name ="sec" select ="floor($time -$hours*3600-$min*60)" /> < xsl:variable select =" concat( format-number($year,'0000'),'-', format-number($month+1,'00'),'-', format-number( $year-offset -sum($date:month/*[$month>=position()]) +(2>$month and (($year mod 4=0 and $year mod 100!=0) or $year mod 400=0)), '00'),'T', format-number($hours,'00'),':', format-number($min,'00'),':', format-number($sec,'00'),'.', format-number( 1000*($time -$hours*3600 -$min*60-$sec), '000'),'Z')" /> </ xsl:if > </ xsl:template >
< xsl:template name ="date:date-time" > < xsl:param name ="timestamp" /> < xsl:if test ="not(format-number($timestamp,0)='NaN')" > < xsl:variable name ="days" select ="$timestamp div (24*3600000)" /> < xsl:variable name ="time" select =" $timestamp div 1000 -floor($days)*24*3600" /> < xsl:variable name ="year" select =" 1970+floor( format-number($days div 365.24,'0.#'))" /> < xsl:variable name ="year-offset" select =" 719528-$year*365 -floor($year div 4) +floor($year div 100) -floor($year div 400) +floor($days)"/> < xsl:variable name ="month" select =" count($date:month /*[$year-offset>=sum(preceding-sibling::*)][last()] /preceding-sibling::*)" /> < xsl:variable name ="hours" select ="floor($time div 3600)" /> < xsl:variable name ="min" select ="floor($time div 60-$hours*60)" /> < xsl:variable name ="sec" select ="floor($time -$hours*3600-$min*60)" /> < xsl:variable select =" concat( format-number($year,'0000'),'-', format-number($month+1,'00'),'-', format-number( $year-offset -sum($date:month/*[$month>=position()]) +(2>$month and (($year mod 4=0 and $year mod 100!=0) or $year mod 400=0)), '00'),'T', format-number($hours,'00'),':', format-number($min,'00'),':', format-number($sec,'00'),'.', format-number( 1000*($time -$hours*3600 -$min*60-$sec), '000'),'Z')" /> </ xsl:if > </ xsl:template >
< xsl:template name ="date:date-time" > < xsl:param name ="timestamp" /> < xsl:if test ="not(format-number($timestamp,0)='NaN')" > < xsl:variable name ="days" select ="$timestamp div (24*3600000)" /> < xsl:variable name ="time" select =" $timestamp div 1000 -floor($days)*24*3600" /> < xsl:variable name ="year" select =" 1970+floor( format-number($days div 365.24,'0.#'))" /> < xsl:variable name ="year-offset" select =" 719528-$year*365 -floor($year div 4) +floor($year div 100) -floor($year div 400) +floor($days)"/> < xsl:variable name ="month" select =" count($date:month /*[$year-offset>=sum(preceding-sibling::*)][last()] /preceding-sibling::*)" /> < xsl:variable name ="hours" select ="floor($time div 3600)" /> < xsl:variable name ="min" select ="floor($time div 60-$hours*60)" /> < xsl:variable name ="sec" select ="floor($time -$hours*3600-$min*60)" /> < xsl:variable select =" concat( format-number($year,'0000'),'-', format-number($month+1,'00'),'-', format-number( $year-offset -sum($date:month/*[$month>=position()]) +(2>$month and (($year mod 4=0 and $year mod 100!=0) or $year mod 400=0)), '00'),'T', format-number($hours,'00'),':', format-number($min,'00'),':', format-number($sec,'00'),'.', format-number( 1000*($time -$hours*3600 -$min*60-$sec), '000'),'Z')" /> </ xsl:if > </ xsl:template >
< xsl:template name ="date:date-time" > < xsl:param name ="timestamp" /> < xsl:if test ="not(format-number($timestamp,0)='NaN')" > < xsl:variable name ="days" select ="$timestamp div (24*3600000)" /> < xsl:variable name ="time" select =" $timestamp div 1000 -floor($days)*24*3600" /> < xsl:variable name ="year" select =" 1970+floor( format-number($days div 365.24,'0.#'))" /> < xsl:variable name ="year-offset" select =" 719528-$year*365 -floor($year div 4) +floor($year div 100) -floor($year div 400) +floor($days)"/> < xsl:variable name ="month" select =" count($date:month /*[$year-offset>=sum(preceding-sibling::*)][last()] /preceding-sibling::*)" /> < xsl:variable name ="hours" select ="floor($time div 3600)" /> < xsl:variable name ="min" select ="floor($time div 60-$hours*60)" /> < xsl:variable name ="sec" select ="floor($time -$hours*3600-$min*60)" /> < xsl:variable select =" concat( format-number($year,'0000'),'-', format-number($month+1,'00'),'-', format-number( $year-offset -sum($date:month/*[$month>=position()]) +(2>$month and (($year mod 4=0 and $year mod 100!=0) or $year mod 400=0)), '00'),'T', format-number($hours,'00'),':', format-number($min,'00'),':', format-number($sec,'00'),'.', format-number( 1000*($time -$hours*3600 -$min*60-$sec), '000'),'Z')" /> </ xsl:if > </ xsl:template >
< xsl:template name ="date:date-time" > < xsl:param name ="timestamp" /> < xsl:if test ="not(format-number($timestamp,0)='NaN')" > < xsl:variable name ="days" select ="$timestamp div (24*3600000)" /> < xsl:variable name ="time" select =" $timestamp div 1000 -floor($days)*24*3600" /> < xsl:variable name ="year" select =" 1970+floor( format-number($days div 365.24,'0.#'))" /> < xsl:variable name ="year-offset" select =" 719528-$year*365 -floor($year div 4) +floor($year div 100) -floor($year div 400) +floor($days)"/> < xsl:variable name ="month" select =" count($date:month /*[$year-offset>=sum(preceding-sibling::*)][last()] /preceding-sibling::*)" /> < xsl:variable name ="hours" select ="floor($time div 3600)" /> < xsl:variable name ="min" select ="floor($time div 60-$hours*60)" /> < xsl:variable name ="sec" select ="floor($time -$hours*3600-$min*60)" /> < xsl:variable select =" concat( format-number($year,'0000'),'-', format-number($month+1,'00'),'-', format-number( $year-offset -sum($date:month/*[$month>=position()]) +(2>$month and (($year mod 4=0 and $year mod 100!=0) or $year mod 400=0)), '00'),'T', format-number($hours,'00'),':', format-number($min,'00'),':', format-number($sec,'00'),'.', format-number( 1000*($time -$hours*3600 -$min*60-$sec), '000'),'Z')" /> </ xsl:if > </ xsl:template >
< xsl:template name ="date:date-time" > < xsl:param name ="timestamp" /> < xsl:if test ="not(format-number($timestamp,0)='NaN')" > < xsl:variable name ="days" select ="$timestamp div (24*3600000)" /> < xsl:variable name ="time" select =" $timestamp div 1000 -floor($days)*24*3600" /> < xsl:variable name ="year" select =" 1970+floor( format-number($days div 365.24,'0.#'))" /> < xsl:variable name ="year-offset" select =" 719528-$year*365 -floor($year div 4) +floor($year div 100) -floor($year div 400) +floor($days)"/> < xsl:variable name ="month" select =" count($date:month /*[$year-offset>=sum(preceding-sibling::*)][last()] /preceding-sibling::*)" /> < xsl:variable name ="hours" select ="floor($time div 3600)" /> < xsl:variable name ="min" select ="floor($time div 60-$hours*60)" /> < xsl:variable name ="sec" select ="floor($time -$hours*3600-$min*60)" /> < xsl:variable select =" concat( format-number($year,'0000'),'-', format-number($month+1,'00'),'-', format-number( $year-offset -sum($date:month/*[$month>=position()]) +(2>$month and (($year mod 4=0 and $year mod 100!=0) or $year mod 400=0)), '00'),'T', format-number($hours,'00'),':', format-number($min,'00'),':', format-number($sec,'00'),'.', format-number( 1000*($time -$hours*3600 -$min*60-$sec), '000'),'Z')" /> </ xsl:if > </ xsl:template >
< xsl:template name ="date:date-time" > < xsl:param name ="timestamp" /> < xsl:if test ="not(format-number($timestamp,0)='NaN')" > < xsl:variable name ="days" select ="$timestamp div (24*3600000)" /> < xsl:variable name ="time" select =" $timestamp div 1000 -floor($days)*24*3600" /> < xsl:variable name ="year" select =" 1970+floor( format-number($days div 365.24,'0.#'))" /> < xsl:variable name ="year-offset" select =" 719528-$year*365 -floor($year div 4) +floor($year div 100) -floor($year div 400) +floor($days)"/> < xsl:variable name ="month" select =" count($date:month /*[$year-offset>=sum(preceding-sibling::*)][last()] /preceding-sibling::*)" /> < xsl:variable name ="hours" select ="floor($time div 3600)" /> < xsl:variable name ="min" select ="floor($time div 60-$hours*60)" /> < xsl:variable name ="sec" select ="floor($time -$hours*3600-$min*60)" /> < xsl:variable select =" concat( format-number($year,'0000'),'-', format-number($month+1,'00'),'-', format-number( $year-offset -sum($date:month/*[$month>=position()]) +(2>$month and (($year mod 4=0 and $year mod 100!=0) or $year mod 400=0)), '00'),'T', format-number($hours,'00'),':', format-number($min,'00'),':', format-number($sec,'00'),'.', format-number( 1000*($time -$hours*3600 -$min*60-$sec), '000'),'Z')" /> </ xsl:if > </ xsl:template >
< xsl:template name ="date:date-time" > < xsl:param name ="timestamp" /> < xsl:if test ="not(format-number($timestamp,0)='NaN')" > < xsl:variable name ="days" select ="$timestamp div (24*3600000)" /> < xsl:variable name ="time" select =" $timestamp div 1000 -floor($days)*24*3600" /> < xsl:variable name ="year" select =" 1970+floor( format-number($days div 365.24,'0.#'))" /> < xsl:variable name ="year-offset" select =" 719528-$year*365 -floor($year div 4) +floor($year div 100) -floor($year div 400) +floor($days)"/> < xsl:variable name ="month" select =" count($date:month /*[$year-offset>=sum(preceding-sibling::*)][last()] /preceding-sibling::*)" /> < xsl:variable name ="hours" select ="floor($time div 3600)" /> < xsl:variable name ="min" select ="floor($time div 60-$hours*60)" /> < xsl:variable name ="sec" select ="floor($time -$hours*3600-$min*60)" /> < xsl:variable select =" concat( format-number($year,'0000'),'-', format-number($month+1,'00'),'-', format-number( $year-offset -sum($date:month/*[$month>=position()]) +(2>$month and (($year mod 4=0 and $year mod 100!=0) or $year mod 400=0)), '00'),'T', format-number($hours,'00'),':', format-number($min,'00'),':', format-number($sec,'00'),'.', format-number( 1000*($time -$hours*3600 -$min*60-$sec), '000'),'Z')" /> </ xsl:if > </ xsl:template >
< xsl:template name ="date:date-time" > < xsl:param name ="timestamp" /> < xsl:if test ="not(format-number($timestamp,0)='NaN')" > < xsl:variable name ="days" select ="$timestamp div (24*3600000)" /> < xsl:variable name ="time" select =" $timestamp div 1000 -floor($days)*24*3600" /> < xsl:variable name ="year" select =" 1970+floor( format-number($days div 365.24,'0.#'))" /> < xsl:variable name ="year-offset" select =" 719528-$year*365 -floor($year div 4) +floor($year div 100) -floor($year div 400) +floor($days)"/> < xsl:variable name ="month" select =" count($date:month /*[$year-offset>=sum(preceding-sibling::*)][last()] /preceding-sibling::*)" /> < xsl:variable name ="hours" select ="floor($time div 3600)" /> < xsl:variable name ="min" select ="floor($time div 60-$hours*60)" /> < xsl:variable name ="sec" select ="floor($time -$hours*3600-$min*60)" /> < xsl:variable select =" concat( format-number($year,'0000'),'-', format-number($month+1,'00'),'-', format-number( $year-offset -sum($date:month/*[$month>=position()]) +(2>$month and (($year mod 4=0 and $year mod 100!=0) or $year mod 400=0)), '00'),'T', format-number($hours,'00'),':', format-number($min,'00'),':', format-number($sec,'00'),'.', format-number( 1000*($time -$hours*3600 -$min*60-$sec), '000'),'Z')" /> </ xsl:if > </ xsl:template >
< xsl:template name ="date:date-time" > < xsl:param name ="timestamp" /> < xsl:if test ="not(format-number($timestamp,0)='NaN')" > < xsl:variable name ="days" select ="$timestamp div (24*3600000)" /> < xsl:variable name ="time" select =" $timestamp div 1000 -floor($days)*24*3600" /> < xsl:variable name ="year" select =" 1970+floor( format-number($days div 365.24,'0.#'))" /> < xsl:variable name ="year-offset" select =" 719528-$year*365 -floor($year div 4) +floor($year div 100) -floor($year div 400) +floor($days)"/> < xsl:variable name ="month" select =" count($date:month /*[$year-offset>=sum(preceding-sibling::*)][last()] /preceding-sibling::*)" /> < xsl:variable name ="hours" select ="floor($time div 3600)" /> < xsl:variable name ="min" select ="floor($time div 60-$hours*60)" /> < xsl:variable name ="sec" select ="floor($time -$hours*3600-$min*60)" /> < xsl:variable select =" concat( format-number($year,'0000'),'-', format-number($month+1,'00'),'-', format-number( $year-offset -sum($date:month/*[$month>=position()]) +(2>$month and (($year mod 4=0 and $year mod 100!=0) or $year mod 400=0)), '00'),'T', format-number($hours,'00'),':', format-number($min,'00'),':', format-number($sec,'00'),'.', format-number( 1000*($time -$hours*3600 -$min*60-$sec), '000'),'Z')" /> </ xsl:if > </ xsl:template >
< xsl:template name ="date:date-time" > < xsl:param name ="timestamp" /> < xsl:if test ="not(format-number($timestamp,0)='NaN')" > < xsl:variable name ="days" select ="$timestamp div (24*3600000)" /> < xsl:variable name ="time" select =" $timestamp div 1000 -floor($days)*24*3600" /> < xsl:variable name ="year" select =" 1970+floor( format-number($days div 365.24,'0.#'))" /> < xsl:variable name ="year-offset" select =" 719528-$year*365 -floor($year div 4) +floor($year div 100) -floor($year div 400) +floor($days)"/> < xsl:variable name ="month" select =" count($date:month /*[$year-offset>=sum(preceding-sibling::*)][last()] /preceding-sibling::*)" /> < xsl:variable name ="hours" select ="floor($time div 3600)" /> < xsl:variable name ="min" select ="floor($time div 60-$hours*60)" /> < xsl:variable name ="sec" select ="floor($time -$hours*3600-$min*60)" /> < xsl:variable select =" concat( format-number($year,'0000'),'-', format-number($month+1,'00'),'-', format-number( $year-offset -sum($date:month/*[$month>=position()]) +(2>$month and (($year mod 4=0 and $year mod 100!=0) or $year mod 400=0)), '00'),'T', format-number($hours,'00'),':', format-number($min,'00'),':', format-number($sec,'00'),'.', format-number( 1000*($time -$hours*3600 -$min*60-$sec), '000'),'Z')" /> </ xsl:if > </ xsl:template >
< xsl:template name ="date:date-time" > < xsl:param name ="timestamp" /> < xsl:if test ="not(format-number($timestamp,0)='NaN')" > < xsl:variable name ="days" select ="$timestamp div (24*3600000)" /> < xsl:variable name ="time" select =" $timestamp div 1000 -floor($days)*24*3600" /> < xsl:variable name ="year" select =" 1970+floor( format-number($days div 365.24,'0.#'))" /> < xsl:variable name ="year-offset" select =" 719528-$year*365 -floor($year div 4) +floor($year div 100) -floor($year div 400) +floor($days)"/> < xsl:variable name ="month" select =" count($date:month /*[$year-offset>=sum(preceding-sibling::*)][last()] /preceding-sibling::*)" /> < xsl:variable name ="hours" select ="floor($time div 3600)" /> < xsl:variable name ="min" select ="floor($time div 60-$hours*60)" /> < xsl:variable name ="sec" select ="floor($time -$hours*3600-$min*60)" /> < xsl:variable select =" concat( format-number($year,'0000'),'-', format-number($month+1,'00'),'-', format-number( $year-offset -sum($date:month/*[$month>=position()]) +(2>$month and (($year mod 4=0 and $year mod 100!=0) or $year mod 400=0)), '00'),'T', format-number($hours,'00'),':', format-number($min,'00'),':', format-number($sec,'00'),'.', format-number( 1000*($time -$hours*3600 -$min*60-$sec), '000'),'Z')" /> </ xsl:if > </ xsl:template >
< xsl:template name ="date:date-time" > < xsl:param name ="timestamp" /> < xsl:if test ="not(format-number($timestamp,0)='NaN')" > < xsl:variable name ="days" select ="$timestamp div (24*3600000)" /> < xsl:variable name ="time" select =" $timestamp div 1000 -floor($days)*24*3600" /> < xsl:variable name ="year" select =" 1970+floor( format-number($days div 365.24,'0.#'))" /> < xsl:variable name ="year-offset" select =" 719528-$year*365 -floor($year div 4) +floor($year div 100) -floor($year div 400) +floor($days)"/> < xsl:variable name ="month" select =" count($date:month /*[$year-offset>=sum(preceding-sibling::*)][last()] /preceding-sibling::*)" /> < xsl:variable name ="hours" select ="floor($time div 3600)" /> < xsl:variable name ="min" select ="floor($time div 60-$hours*60)" /> < xsl:variable name ="sec" select ="floor($time -$hours*3600-$min*60)" /> < xsl:variable select =" concat( format-number($year,'0000'),'-', format-number($month+1,'00'),'-', format-number( $year-offset -sum($date:month/*[$month>=position()]) +(2>$month and (($year mod 4=0 and $year mod 100!=0) or $year mod 400=0)), '00'),'T', format-number($hours,'00'),':', format-number($min,'00'),':', format-number($sec,'00'),'.', format-number( 1000*($time -$hours*3600 -$min*60-$sec), '000'),'Z')" /> </ xsl:if > </ xsl:template >
< xsl:template name ="date:date-time" > < xsl:param name ="timestamp" /> < xsl:if test ="not(format-number($timestamp,0)='NaN')" > < xsl:variable name ="days" select ="$timestamp div (24*3600000)" /> < xsl:variable name ="time" select =" $timestamp div 1000 -floor($days)*24*3600" /> < xsl:variable name ="year" select =" 1970+floor( format-number($days div 365.24,'0.#'))" /> < xsl:variable name ="year-offset" select =" 719528-$year*365 -floor($year div 4) +floor($year div 100) -floor($year div 400) +floor($days)"/> < xsl:variable name ="month" select =" count($date:month /*[$year-offset>=sum(preceding-sibling::*)][last()] /preceding-sibling::*)" /> < xsl:variable name ="hours" select ="floor($time div 3600)" /> < xsl:variable name ="min" select ="floor($time div 60-$hours*60)" /> < xsl:variable name ="sec" select ="floor($time -$hours*3600-$min*60)" /> < xsl:variable select =" concat( format-number($year,'0000'),'-', format-number($month+1,'00'),'-', format-number( $year-offset -sum($date:month/*[$month>=position()]) +(2>$month and (($year mod 4=0 and $year mod 100!=0) or $year mod 400=0)), '00'),'T', format-number($hours,'00'),':', format-number($min,'00'),':', format-number($sec,'00'),'.', format-number( 1000*($time -$hours*3600 -$min*60-$sec), '000'),'Z')" /> </ xsl:if > </ xsl:template >
< xsl:template name ="date:date-time" > < xsl:param name ="timestamp" /> < xsl:if test ="not(format-number($timestamp,0)='NaN')" > < xsl:variable name ="days" select ="$timestamp div (24*3600000)" /> < xsl:variable name ="time" select =" $timestamp div 1000 -floor($days)*24*3600" /> < xsl:variable name ="year" select =" 1970+floor( format-number($days div 365.24,'0.#'))" /> < xsl:variable name ="year-offset" select =" 719528-$year*365 -floor($year div 4) +floor($year div 100) -floor($year div 400) +floor($days)"/> < xsl:variable name ="month" select =" count($date:month /*[$year-offset>=sum(preceding-sibling::*)][last()] /preceding-sibling::*)" /> < xsl:variable name ="hours" select ="floor($time div 3600)" /> < xsl:variable name ="min" select ="floor($time div 60-$hours*60)" /> < xsl:variable name ="sec" select ="floor($time -$hours*3600-$min*60)" /> < xsl:variable select =" concat( format-number($year,'0000'),'-', format-number($month+1,'00'),'-', format-number( $year-offset -sum($date:month/*[$month>=position()]) +(2>$month and (($year mod 4=0 and $year mod 100!=0) or $year mod 400=0)), '00'),'T', format-number($hours,'00'),':', format-number($min,'00'),':', format-number($sec,'00'),'.', format-number( 1000*($time -$hours*3600 -$min*60-$sec), '000'),'Z')" /> </ xsl:if > </ xsl:template >
< xsl:template name ="date:date-time" > < xsl:param name ="timestamp" /> < xsl:if test ="not(format-number($timestamp,0)='NaN')" > < xsl:variable name ="days" select ="$timestamp div (24*3600000)" /> < xsl:variable name ="time" select =" $timestamp div 1000 -floor($days)*24*3600" /> < xsl:variable name ="year" select =" 1970+floor( format-number($days div 365.24,'0.#'))" /> < xsl:variable name ="year-offset" select =" 719528-$year*365 -floor($year div 4) +floor($year div 100) -floor($year div 400) +floor($days)"/> < xsl:variable name ="month" select =" count($date:month /*[$year-offset>=sum(preceding-sibling::*)][last()] /preceding-sibling::*)" /> < xsl:variable name ="hours" select ="floor($time div 3600)" /> < xsl:variable name ="min" select ="floor($time div 60-$hours*60)" /> < xsl:variable name ="sec" select ="floor($time -$hours*3600-$min*60)" /> < xsl:variable select =" concat( format-number($year,'0000'),'-', format-number($month+1,'00'),'-', format-number( $year-offset -sum($date:month/*[$month>=position()]) +(2>$month and (($year mod 4=0 and $year mod 100!=0) or $year mod 400=0)), '00'),'T', format-number($hours,'00'),':', format-number($min,'00'),':', format-number($sec,'00'),'.', format-number( 1000*($time -$hours*3600 -$min*60-$sec), '000'),'Z')" /> </ xsl:if > </ xsl:template >
< xsl:template name ="date:date-time" > < xsl:param name ="timestamp" /> < xsl:if test ="not(format-number($timestamp,0)='NaN')" > < xsl:variable name ="days" select ="$timestamp div (24*3600000)" /> < xsl:variable name ="time" select =" $timestamp div 1000 -floor($days)*24*3600" /> < xsl:variable name ="year" select =" 1970+floor( format-number($days div 365.24,'0.#'))" /> < xsl:variable name ="year-offset" select =" 719528-$year*365 -floor($year div 4) +floor($year div 100) -floor($year div 400) +floor($days)"/> < xsl:variable name ="month" select =" count($date:month /*[$year-offset>=sum(preceding-sibling::*)][last()] /preceding-sibling::*)" /> < xsl:variable name ="hours" select ="floor($time div 3600)" /> < xsl:variable name ="min" select ="floor($time div 60-$hours*60)" /> < xsl:variable name ="sec" select ="floor($time -$hours*3600-$min*60)" /> < xsl:variable select =" concat( format-number($year,'0000'),'-', format-number($month+1,'00'),'-', format-number( $year-offset -sum($date:month/*[$month>=position()]) +(2>$month and (($year mod 4=0 and $year mod 100!=0) or $year mod 400=0)), '00'),'T', format-number($hours,'00'),':', format-number($min,'00'),':', format-number($sec,'00'),'.', format-number( 1000*($time -$hours*3600 -$min*60-$sec), '000'),'Z')" /> </ xsl:if > </ xsl:template >
< xsl:template name ="date:date-time" > < xsl:param name ="timestamp" /> < xsl:if test ="not(format-number($timestamp,0)='NaN')" > < xsl:variable name ="days" select ="$timestamp div (24*3600000)" /> < xsl:variable name ="time" select =" $timestamp div 1000 -floor($days)*24*3600" /> < xsl:variable name ="year" select =" 1970+floor( format-number($days div 365.24,'0.#'))" /> < xsl:variable name ="year-offset" select =" 719528-$year*365 -floor($year div 4) +floor($year div 100) -floor($year div 400) +floor($days)"/> < xsl:variable name ="month" select =" count($date:month /*[$year-offset>=sum(preceding-sibling::*)][last()] /preceding-sibling::*)" /> < xsl:variable name ="hours" select ="floor($time div 3600)" /> < xsl:variable name ="min" select ="floor($time div 60-$hours*60)" /> < xsl:variable name ="sec" select ="floor($time -$hours*3600-$min*60)" /> < xsl:variable select =" concat( format-number($year,'0000'),'-', format-number($month+1,'00'),'-', format-number( $year-offset -sum($date:month/*[$month>=position()]) +(2>$month and (($year mod 4=0 and $year mod 100!=0) or $year mod 400=0)), '00'),'T', format-number($hours,'00'),':', format-number($min,'00'),':', format-number($sec,'00'),'.', format-number( 1000*($time -$hours*3600 -$min*60-$sec), '000'),'Z')" /> </ xsl:if > </ xsl:template >
< xsl:template name ="date:date-time" > < xsl:param name ="timestamp" /> < xsl:if test ="not(format-number($timestamp,0)='NaN')" > < xsl:variable name ="days" select ="$timestamp div (24*3600000)" /> < xsl:variable name ="time" select =" $timestamp div 1000 -floor($days)*24*3600" /> < xsl:variable name ="year" select =" 1970+floor( format-number($days div 365.24,'0.#'))" /> < xsl:variable name ="year-offset" select =" 719528-$year*365 -floor($year div 4) +floor($year div 100) -floor($year div 400) +floor($days)"/> < xsl:variable name ="month" select =" count($date:month /*[$year-offset>=sum(preceding-sibling::*)][last()] /preceding-sibling::*)" /> < xsl:variable name ="hours" select ="floor($time div 3600)" /> < xsl:variable name ="min" select ="floor($time div 60-$hours*60)" /> < xsl:variable name ="sec" select ="floor($time -$hours*3600-$min*60)" /> < xsl:variable select =" concat( format-number($year,'0000'),'-', format-number($month+1,'00'),'-', format-number( $year-offset -sum($date:month/*[$month>=position()]) +(2>$month and (($year mod 4=0 and $year mod 100!=0) or $year mod 400=0)), '00'),'T', format-number($hours,'00'),':', format-number($min,'00'),':', format-number($sec,'00'),'.', format-number( 1000*($time -$hours*3600 -$min*60-$sec), '000'),'Z')" /> </ xsl:if > </ xsl:template >
< xsl:template name ="date:date-time" > < xsl:param name ="timestamp" /> < xsl:if test ="not(format-number($timestamp,0)='NaN')" > < xsl:variable name ="days" select ="$timestamp div (24*3600000)" /> < xsl:variable name ="time" select =" $timestamp div 1000 -floor($days)*24*3600" /> < xsl:variable name ="year" select =" 1970+floor( format-number($days div 365.24,'0.#'))" /> < xsl:variable name ="year-offset" select =" 719528-$year*365 -floor($year div 4) +floor($year div 100) -floor($year div 400) +floor($days)"/> < xsl:variable name ="month" select =" count($date:month /*[$year-offset>=sum(preceding-sibling::*)][last()] /preceding-sibling::*)" /> < xsl:variable name ="hours" select ="floor($time div 3600)" /> < xsl:variable name ="min" select ="floor($time div 60-$hours*60)" /> < xsl:variable name ="sec" select ="floor($time -$hours*3600-$min*60)" /> < xsl:variable select =" concat( format-number($year,'0000'),'-', format-number($month+1,'00'),'-', format-number( $year-offset -sum($date:month/*[$month>=position()]) +(2>$month and (($year mod 4=0 and $year mod 100!=0) or $year mod 400=0)), '00'),'T', format-number($hours,'00'),':', format-number($min,'00'),':', format-number($sec,'00'),'.', format-number( 1000*($time -$hours*3600 -$min*60-$sec), '000'),'Z')" /> </ xsl:if > </ xsl:template >
< xsl:template name ="date:date-time" > < xsl:param name ="timestamp" /> < xsl:if test ="not(format-number($timestamp,0)='NaN')" > < xsl:variable name ="days" select ="$timestamp div (24*3600000)" /> < xsl:variable name ="time" select =" $timestamp div 1000 -floor($days)*24*3600" /> < xsl:variable name ="year" select =" 1970+floor( format-number($days div 365.24,'0.#'))" /> < xsl:variable name ="year-offset" select =" 719528-$year*365 -floor($year div 4) +floor($year div 100) -floor($year div 400) +floor($days)"/> < xsl:variable name ="month" select =" count($date:month /*[$year-offset>=sum(preceding-sibling::*)][last()] /preceding-sibling::*)" /> < xsl:variable name ="hours" select ="floor($time div 3600)" /> < xsl:variable name ="min" select ="floor($time div 60-$hours*60)" /> < xsl:variable name ="sec" select ="floor($time -$hours*3600-$min*60)" /> < xsl:variable select =" concat( format-number($year,'0000'),'-', format-number($month+1,'00'),'-', format-number( $year-offset -sum($date:month/*[$month>=position()]) +(2>$month and (($year mod 4=0 and $year mod 100!=0) or $year mod 400=0)), '00'),'T', format-number($hours,'00'),':', format-number($min,'00'),':', format-number($sec,'00'),'.', format-number( 1000*($time -$hours*3600 -$min*60-$sec), '000'),'Z')" /> </ xsl:if > </ xsl:template >
< xsl:template name ="date:date-time" > < xsl:param name ="timestamp" /> < xsl:if test ="not(format-number($timestamp,0)='NaN')" > < xsl:variable name ="days" select ="$timestamp div (24*3600000)" /> < xsl:variable name ="time" select =" $timestamp div 1000 -floor($days)*24*3600" /> < xsl:variable name ="year" select =" 1970+floor( format-number($days div 365.24,'0.#'))" /> < xsl:variable name ="year-offset" select =" 719528-$year*365 -floor($year div 4) +floor($year div 100) -floor($year div 400) +floor($days)"/> < xsl:variable name ="month" select =" count($date:month /*[$year-offset>=sum(preceding-sibling::*)][last()] /preceding-sibling::*)" /> < xsl:variable name ="hours" select ="floor($time div 3600)" /> < xsl:variable name ="min" select ="floor($time div 60-$hours*60)" /> < xsl:variable name ="sec" select ="floor($time -$hours*3600-$min*60)" /> < xsl:variable select =" concat( format-number($year,'0000'),'-', format-number($month+1,'00'),'-', format-number( $year-offset -sum($date:month/*[$month>=position()]) +(2>$month and (($year mod 4=0 and $year mod 100!=0) or $year mod 400=0)), '00'),'T', format-number($hours,'00'),':', format-number($min,'00'),':', format-number($sec,'00'),'.', format-number( 1000*($time -$hours*3600 -$min*60-$sec), '000'),'Z')" /> </ xsl:if > </ xsl:template >
< xsl:template name ="date:date-time" > < xsl:param name ="timestamp" /> < xsl:if test ="not(format-number($timestamp,0)='NaN')" > < xsl:variable name ="days" select ="$timestamp div (24*3600000)" /> < xsl:variable name ="time" select =" $timestamp div 1000 -floor($days)*24*3600" /> < xsl:variable name ="year" select =" 1970+floor( format-number($days div 365.24,'0.#'))" /> < xsl:variable name ="year-offset" select =" 719528-$year*365 -floor($year div 4) +floor($year div 100) -floor($year div 400) +floor($days)"/> < xsl:variable name ="month" select =" count($date:month /*[$year-offset>=sum(preceding-sibling::*)][last()] /preceding-sibling::*)" /> < xsl:variable name ="hours" select ="floor($time div 3600)" /> < xsl:variable name ="min" select ="floor($time div 60-$hours*60)" /> < xsl:variable name ="sec" select ="floor($time -$hours*3600-$min*60)" /> < xsl:variable select =" concat( format-number($year,'0000'),'-', format-number($month+1,'00'),'-', format-number( $year-offset -sum($date:month/*[$month>=position()]) +(2>$month and (($year mod 4=0 and $year mod 100!=0) or $year mod 400=0)), '00'),'T', format-number($hours,'00'),':', format-number($min,'00'),':', format-number($sec,'00'),'.', format-number( 1000*($time -$hours*3600 -$min*60-$sec), '000'),'Z')" /> </ xsl:if > </ xsl:template >
< xsl:template name ="date:date-time" > < xsl:param name ="timestamp" /> < xsl:if test ="not(format-number($timestamp,0)='NaN')" > < xsl:variable name ="days" select ="$timestamp div (24*3600000)" /> < xsl:variable name ="time" select =" $timestamp div 1000 -floor($days)*24*3600" /> < xsl:variable name ="year" select =" 1970+floor( format-number($days div 365.24,'0.#'))" /> < xsl:variable name ="year-offset" select =" 719528-$year*365 -floor($year div 4) +floor($year div 100) -floor($year div 400) +floor($days)"/> < xsl:variable name ="month" select =" count($date:month /*[$year-offset>=sum(preceding-sibling::*)][last()] /preceding-sibling::*)" /> < xsl:variable name ="hours" select ="floor($time div 3600)" /> < xsl:variable name ="min" select ="floor($time div 60-$hours*60)" /> < xsl:variable name ="sec" select ="floor($time -$hours*3600-$min*60)" /> < xsl:variable select =" concat( format-number($year,'0000'),'-', format-number($month+1,'00'),'-', format-number( $year-offset -sum($date:month/*[$month>=position()]) +(2>$month and (($year mod 4=0 and $year mod 100!=0) or $year mod 400=0)), '00'),'T', format-number($hours,'00'),':', format-number($min,'00'),':', format-number($sec,'00'),'.', format-number( 1000*($time -$hours*3600 -$min*60-$sec), '000'),'Z')" /> </ xsl:if > </ xsl:template >
< xsl:template name ="date:date-time" > < xsl:param name ="timestamp" /> < xsl:if test ="not(format-number($timestamp,0)='NaN')" > < xsl:variable name ="days" select ="$timestamp div (24*3600000)" /> < xsl:variable name ="time" select =" $timestamp div 1000 -floor($days)*24*3600" /> < xsl:variable name ="year" select =" 1970+floor( format-number($days div 365.24,'0.#'))" /> < xsl:variable name ="year-offset" select =" 719528-$year*365 -floor($year div 4) +floor($year div 100) -floor($year div 400) +floor($days)"/> < xsl:variable name ="month" select =" count($date:month /*[$year-offset>=sum(preceding-sibling::*)][last()] /preceding-sibling::*)" /> < xsl:variable name ="hours" select ="floor($time div 3600)" /> < xsl:variable name ="min" select ="floor($time div 60-$hours*60)" /> < xsl:variable name ="sec" select ="floor($time -$hours*3600-$min*60)" /> < xsl:variable select =" concat( format-number($year,'0000'),'-', format-number($month+1,'00'),'-', format-number( $year-offset -sum($date:month/*[$month>=position()]) +(2>$month and (($year mod 4=0 and $year mod 100!=0) or $year mod 400=0)), '00'),'T', format-number($hours,'00'),':', format-number($min,'00'),':', format-number($sec,'00'),'.', format-number( 1000*($time -$hours*3600 -$min*60-$sec), '000'),'Z')" /> </ xsl:if > </ xsl:template >
< xsl:template name ="date:date-time" > < xsl:param name ="timestamp" /> < xsl:if test ="not(format-number($timestamp,0)='NaN')" > < xsl:variable name ="days" select ="$timestamp div (24*3600000)" /> < xsl:variable name ="time" select =" $timestamp div 1000 -floor($days)*24*3600" /> < xsl:variable name ="year" select =" 1970+floor( format-number($days div 365.24,'0.#'))" /> < xsl:variable name ="year-offset" select =" 719528-$year*365 -floor($year div 4) +floor($year div 100) -floor($year div 400) +floor($days)"/> < xsl:variable name ="month" select =" count($date:month /*[$year-offset>=sum(preceding-sibling::*)][last()] /preceding-sibling::*)" /> < xsl:variable name ="hours" select ="floor($time div 3600)" /> < xsl:variable name ="min" select ="floor($time div 60-$hours*60)" /> < xsl:variable name ="sec" select ="floor($time -$hours*3600-$min*60)" /> < xsl:variable select =" concat( format-number($year,'0000'),'-', format-number($month+1,'00'),'-', format-number( $year-offset -sum($date:month/*[$month>=position()]) +(2>$month and (($year mod 4=0 and $year mod 100!=0) or $year mod 400=0)), '00'),'T', format-number($hours,'00'),':', format-number($min,'00'),':', format-number($sec,'00'),'.', format-number( 1000*($time -$hours*3600 -$min*60-$sec), '000'),'Z')" /> </ xsl:if > </ xsl:template >
< xsl:template name ="date:date-time" > < xsl:param name ="timestamp" /> < xsl:if test ="not(format-number($timestamp,0)='NaN')" > < xsl:variable name ="days" select ="$timestamp div (24*3600000)" /> < xsl:variable name ="time" select =" $timestamp div 1000 -floor($days)*24*3600" /> < xsl:variable name ="year" select =" 1970+floor( format-number($days div 365.24,'0.#'))" /> < xsl:variable name ="year-offset" select =" 719528-$year*365 -floor($year div 4) +floor($year div 100) -floor($year div 400) +floor($days)"/> < xsl:variable name ="month" select =" count($date:month /*[$year-offset>=sum(preceding-sibling::*)][last()] /preceding-sibling::*)" /> < xsl:variable name ="hours" select ="floor($time div 3600)" /> < xsl:variable name ="min" select ="floor($time div 60-$hours*60)" /> < xsl:variable name ="sec" select ="floor($time -$hours*3600-$min*60)" /> < xsl:variable select =" concat( format-number($year,'0000'),'-', format-number($month+1,'00'),'-', format-number( $year-offset -sum($date:month/*[$month>=position()]) +(2>$month and (($year mod 4=0 and $year mod 100!=0) or $year mod 400=0)), '00'),'T', format-number($hours,'00'),':', format-number($min,'00'),':', format-number($sec,'00'),'.', format-number( 1000*($time -$hours*3600 -$min*60-$sec), '000'),'Z')" /> </ xsl:if > </ xsl:template >
< xsl:template name ="date:date-time" > < xsl:param name ="timestamp" /> < xsl:if test ="not(format-number($timestamp,0)='NaN')" > < xsl:variable name ="days" select ="$timestamp div (24*3600000)" /> < xsl:variable name ="time" select =" $timestamp div 1000 -floor($days)*24*3600" /> < xsl:variable name ="year" select =" 1970+floor( format-number($days div 365.24,'0.#'))" /> < xsl:variable name ="year-offset" select =" 719528-$year*365 -floor($year div 4) +floor($year div 100) -floor($year div 400) +floor($days)"/> < xsl:variable name ="month" select =" count($date:month /*[$year-offset>=sum(preceding-sibling::*)][last()] /preceding-sibling::*)" /> < xsl:variable name ="hours" select ="floor($time div 3600)" /> < xsl:variable name ="min" select ="floor($time div 60-$hours*60)" /> < xsl:variable name ="sec" select ="floor($time -$hours*3600-$min*60)" /> < xsl:variable select =" concat( format-number($year,'0000'),'-', format-number($month+1,'00'),'-', format-number( $year-offset -sum($date:month/*[$month>=position()]) +(2>$month and (($year mod 4=0 and $year mod 100!=0) or $year mod 400=0)), '00'),'T', format-number($hours,'00'),':', format-number($min,'00'),':', format-number($sec,'00'),'.', format-number( 1000*($time -$hours*3600 -$min*60-$sec), '000'),'Z')" /> </ xsl:if > </ xsl:template >
< xsl:template name ="date:date-time" > < xsl:param name ="timestamp" /> < xsl:if test ="not(format-number($timestamp,0)='NaN')" > < xsl:variable name ="days" select ="$timestamp div (24*3600000)" /> < xsl:variable name ="time" select =" $timestamp div 1000 -floor($days)*24*3600" /> < xsl:variable name ="year" select =" 1970+floor( format-number($days div 365.24,'0.#'))" /> < xsl:variable name ="year-offset" select =" 719528-$year*365 -floor($year div 4) +floor($year div 100) -floor($year div 400) +floor($days)"/> < xsl:variable name ="month" select =" count($date:month /*[$year-offset>=sum(preceding-sibling::*)][last()] /preceding-sibling::*)" /> < xsl:variable name ="hours" select ="floor($time div 3600)" /> < xsl:variable name ="min" select ="floor($time div 60-$hours*60)" /> < xsl:variable name ="sec" select ="floor($time -$hours*3600-$min*60)" /> < xsl:variable select =" concat( format-number($year,'0000'),'-', format-number($month+1,'00'),'-', format-number( $year-offset -sum($date:month/*[$month>=position()]) +(2>$month and (($year mod 4=0 and $year mod 100!=0) or $year mod 400=0)), '00'),'T', format-number($hours,'00'),':', format-number($min,'00'),':', format-number($sec,'00'),'.', format-number( 1000*($time -$hours*3600 -$min*60-$sec), '000'),'Z')" /> </ xsl:if > </ xsl:template >
@param前のテンプレートと同様に、単一のパラメーターを取ります。
$timestamp
-1970-01-01T00:00:00Zから経過したミリ秒数。 日付が1970年の初めよりも早い場合、タイムスタンプは負でなければなりません。
@output文字列
[ - | + ] yyyy - MM - dd T hh : mm : ss . SSS Z
[ - | + ] yyyy - MM - dd T hh : mm : ss . SSS Z
マイナスの年とプラスの年の両方でパターンをチェックしました-結果は真実に似ています。 テストとソースは、
rapidshareで取得できます。
急ぎが嫌いな場合は、別の場所に投稿します。