I am not near my computer right now, but I believe if you look at the timestamp field class you can see how it is done.
Sent from my C64 On Sep 15, 2011, at 4:06 AM, Henrik Ingo <henrik.i...@avoinelama.fi> wrote: > Hi > > So I do this: > > SELECT TIMESTAMP(CURDATE()); > > Inside Drizzle this happens: > > (gdb) call args[n]->is_datetime() > $16 = true > (gdb) call args[n]->result_type() > $17 = STRING_RESULT > (gdb) call args[n]->result_as_int64_t() > $18 = true > (gdb) call *args[n]->val_str(str) > $19 = {Ptr = 0xa34ad54f "2011-09-15 00:00:00.000000", str_length = 26, > Alloced_length = 1021, alloced = false, str_charset = 0x8863100} > (gdb) call args[n]->val_real() > $20 = 20110915000000 > (gdb) call args[n]->val_int() > $21 = 20110915000000 > > > I was hoping the val_int and possibly val_real would have given me the > unix timestamp value: amount of milliseconds since 1 Jan 1970. Instead > they return this MySQL invented integer value which has the date and > time in human readable form / essentially just the digits from the > string value packed together. > > I assume there is a function somewhere that gives me the unix > timestamp and I don't need to write my own? > > henrik > > > -- > henrik.i...@avoinelama.fi > +358-40-8211286 skype: henrik.ingo irc: hingo > www.openlife.cc > > My LinkedIn profile: http://www.linkedin.com/profile/view?id=9522559 > > _______________________________________________ > Mailing list: https://launchpad.net/~drizzle-discuss > Post to : drizzle-discuss@lists.launchpad.net > Unsubscribe : https://launchpad.net/~drizzle-discuss > More help : https://help.launchpad.net/ListHelp _______________________________________________ Mailing list: https://launchpad.net/~drizzle-discuss Post to : drizzle-discuss@lists.launchpad.net Unsubscribe : https://launchpad.net/~drizzle-discuss More help : https://help.launchpad.net/ListHelp