Is it possible to serialize Timespan as a DateTime?

23 views
Skip to first unread message

Bruno Tezine

unread,
Jan 23, 2015, 4:02:00 PM1/23/15
to jay...@googlegroups.com
Hi, I wonder if it's possible to serialize a Timespan property as a DateTime instead of:

{"days":0,"hours":11,"milliseconds":0,"minutes":0,"seconds":0,"ticks":396000000000,"totalDays":0.45833333333333298,"totalHours":11,"totalMilliseconds":39600000,"totalMinutes":660,"totalSeconds":39600}

Thank you, 
   Bruno.

Atif Aziz

unread,
Jan 26, 2015, 4:17:34 PM1/26/15
to jay...@googlegroups.com
Yes it is technically possible but speaking logically, what reference date/time would you add to a TimeSpan to get a DateTime?

- Atif

--
You received this message because you are subscribed to the Google Groups "Jayrock" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jayrock+u...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Atif Aziz

unread,
Jan 26, 2015, 5:00:11 PM1/26/15
to jay...@googlegroups.com
In any event, here's an example of showing how you can export a TimeSpan as a DateTime after adding it to DateTime.Now (although that sounds useless, it should nonetheless give you a starting point):


- Atif
Reply all
Reply to author
Forward
0 new messages