Re: casting SysTime to ubyte[]

2015-01-14 Thread Laeeth Isharc via Digitalmars-d-learn
I really wouldn't advise doing that. SysTime contains a long which represents the time in hnsecs since midnight, January 1st, 1 A.D., and that could be written to a file quite easily. But it also contains a reference to a TimeZone object, so what you're doing would just be writing its

Re: casting SysTime to ubyte[]

2015-01-12 Thread Steven Schveighoffer via Digitalmars-d-learn
On 1/12/15 8:59 AM, Laeeth Isharc wrote: import std.datetime; import std.stdio; import std.conv; void main(string[] arg) { auto a=Clock.currTime(); auto b=cast(ubyte[])a; writefln(%s,b); } how do i get the time as a binary representation I can write to a file? You can always

casting SysTime to ubyte[]

2015-01-12 Thread Laeeth Isharc via Digitalmars-d-learn
import std.datetime; import std.stdio; import std.conv; void main(string[] arg) { auto a=Clock.currTime(); auto b=cast(ubyte[])a; writefln(%s,b); } how do i get the time as a binary representation I can write to a file? Thanks.

Re: casting SysTime to ubyte[]

2015-01-12 Thread Daniel Kozák via Digitalmars-d-learn
V Mon, 12 Jan 2015 13:59:27 + Laeeth Isharc via Digitalmars-d-learn digitalmars-d-learn@puremagic.com napsáno: import std.datetime; import std.stdio; import std.conv; void main(string[] arg) { auto a=Clock.currTime(); auto b=cast(ubyte[])a; writefln(%s,b); }

Re: casting SysTime to ubyte[]

2015-01-12 Thread Jonathan M Davis via Digitalmars-d-learn
On Monday, January 12, 2015 13:59:27 Laeeth Isharc via Digitalmars-d-learn wrote: import std.datetime; import std.stdio; import std.conv; void main(string[] arg) { auto a=Clock.currTime(); auto b=cast(ubyte[])a; writefln(%s,b); } how do i get the time as a binary representation