[Lazarus] JSON and Object Pascal DateTime

silvioprog silvioprog at gmail.com
Tue Jan 31 00:55:19 CET 2012


2012/1/30 Michael Van Canneyt <michael at freepascal.org>:
[...]
> Strictly speaking, JSON does not know a date/time object.
> So, how to write it depends on the client application.

Yes, I observe it doesn't deal with date type... ;)

> ExtJS uses by default an ISO format (and expects one as of ExtJS 4):
>
> 1995-07-18T17:21:28-02:00
>
> Which seems the best to do anyway.
>
> Michael.

I would like to avoid ecessive convertions. In the attatched example,
you can see the reasons why I prefer to use another format.

I will use own conversion routines (MSecToDateTime/DateTimeToMSec).
Saving in this format, it's easy to handle with dates without
converting from string to datetime.

-- 
Silvio Clécio
====================================
Site - <silvioprog.com.br>
LazSolutions - <code.google.com/p/lazsolutions>
====================================
-------------- next part --------------
A non-text attachment was scrubbed...
Name: jsondt.zip
Type: application/zip
Size: 1696 bytes
Desc: not available
URL: <http://lists.lazarus-ide.org/pipermail/lazarus/attachments/20120130/d53b5244/attachment-0003.zip>


More information about the Lazarus mailing list