New Rfc3339DateTime function

git-svn-id: https://svn.code.sf.net/p/synalist/code/trunk@276 7c85be65-684b-0410-a082-b2ed4fbef004
This commit is contained in:
geby 2023-11-08 14:02:34 +00:00
parent 0eda92b747
commit 1d96b0dfcd

View File

@ -1,9 +1,9 @@
{==============================================================================| {==============================================================================|
| Project : Ararat Synapse | 004.015.007 | | Project : Ararat Synapse | 004.016.000 |
|==============================================================================| |==============================================================================|
| Content: support procedures and functions | | Content: support procedures and functions |
|==============================================================================| |==============================================================================|
| Copyright (c)1999-2017, Lukas Gebauer | | Copyright (c)1999-2023, Lukas Gebauer |
| All rights reserved. | | All rights reserved. |
| | | |
| Redistribution and use in source and binary forms, with or without | | Redistribution and use in source and binary forms, with or without |
@ -33,7 +33,7 @@
| DAMAGE. | | DAMAGE. |
|==============================================================================| |==============================================================================|
| The Initial Developer of the Original Code is Lukas Gebauer (Czech Republic).| | The Initial Developer of the Original Code is Lukas Gebauer (Czech Republic).|
| Portions created by Lukas Gebauer are Copyright (c) 1999-2017. | | Portions created by Lukas Gebauer are Copyright (c) 1999-2023. |
| Portions created by Hernan Sanchez are Copyright (c) 2000. | | Portions created by Hernan Sanchez are Copyright (c) 2000. |
| Portions created by Petr Fejfar are Copyright (c)2011-2012. | | Portions created by Petr Fejfar are Copyright (c)2011-2012. |
| All Rights Reserved. | | All Rights Reserved. |
@ -124,6 +124,9 @@ function TimeZone: string;
'Fri, 15 Oct 1999 21:14:56 +0200')} 'Fri, 15 Oct 1999 21:14:56 +0200')}
function Rfc822DateTime(t: TDateTime): string; function Rfc822DateTime(t: TDateTime): string;
{:Returns date and time in format defined in RFC-3339 in format "yyyy-mm-ddThh:nn:ss.zzz"}
function Rfc3339DateTime(t: TDateTime): string;
{:Returns date and time in format defined in C compilers in format "mmm dd hh:nn:ss"} {:Returns date and time in format defined in C compilers in format "mmm dd hh:nn:ss"}
function CDateTime(t: TDateTime): string; function CDateTime(t: TDateTime): string;
@ -491,6 +494,13 @@ end;
{==============================================================================} {==============================================================================}
function Rfc3339DateTime(t: TDateTime): string;
begin
Result := FormatDateTime('yyyy"-"mm"-"dd"T"hh":"nn":"ss"."zzz', t) + Timezone;
end;
{==============================================================================}
function CDateTime(t: TDateTime): string; function CDateTime(t: TDateTime): string;
var var
wYear, wMonth, wDay: word; wYear, wMonth, wDay: word;