Ok, basically copy pasting the code from implementation of UNIX_TIMESTAMP() is of course what I want to do, but the problem is that none of the classes in drizzled/temporal.h are exported, so I can't use them from a plugin. Can I add DRIZZLED_API to them at will? Should I do it to all of the classes in that file?
henrik On Fri, Sep 16, 2011 at 9:10 AM, Henrik Ingo <[email protected]> wrote: > Yes, this looks like what I was asking for. I was now interrupted by > "real work", will continue with this later. > > henrik > > On Fri, Sep 16, 2011 at 12:51 AM, Brian Aker <[email protected]> wrote: >> If not, it should be. Very simple function, and we store time via epoch. >> >> >> On Sep 15, 2011, at 8:53 AM, Brian Moon wrote: >> >>> In MySQL it was UNIX_TIMESTAMP(). Is that not still around in Drizzle? >>> >>> Brian. >>> http://brian.moonspot.net >>> >>> On 9/15/11 6:06 AM, Henrik Ingo 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 >>>> >>>> >>> >>> _______________________________________________ >>> Mailing list: https://launchpad.net/~drizzle-discuss >>> Post to : [email protected] >>> Unsubscribe : https://launchpad.net/~drizzle-discuss >>> More help : https://help.launchpad.net/ListHelp >> >> > > > > -- > [email protected] > +358-40-8211286 skype: henrik.ingo irc: hingo > www.openlife.cc > > My LinkedIn profile: http://www.linkedin.com/profile/view?id=9522559 > -- [email protected] +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 : [email protected] Unsubscribe : https://launchpad.net/~drizzle-discuss More help : https://help.launchpad.net/ListHelp

