List:General Discussion« Previous MessageNext Message »
From:Chris Date:November 29 2004 5:10am
Subject:Re: Using epoch date instead of calendar date
View as plain text  
So phpnuke just a a string representation...

As far as I know, It's not possible to do it with just MySQL, though 
there may be some function I'm not aware of.

The Unix binary `strtotime`, used to convert a multitude of readable 
date formats into a Unix timestamp, should be able to do that. So you 
could retrieve the users table from phpnuke with some script, run it 
through strtotime, then insert the altered value into the xoops.

PHP has the strtotime() function, and I'd be surprised if Perl didn't 
have it.

Chris

Eric Wagar wrote:

>Looking at the structure of xoops.users shows the users_regdate as int(10), 
>and phpnuke.users is varchar(20).
>
>This means that phpnuke.users would need to be ||UNIX_TIMESTAMP().  And, I see 
>in the MySQL book (2nd ed., pg 828) that UNIX_TIMESTAMP works with date-time 
>or timestamp format of ccyymmdd or yymmdd, which is different than the May 1, 
>2004, example.
>
>Should I assume that I need to run some type of script against that column of 
>data?  If so, how do I do it?
>
>Thanks
>Eric
>
>  
>
>>I don't have experience with either of those programs, but I think you
>>can convert them.
>>
>>It looks like phpnuke is keeping the date in a DATE (or maybe a DATETIME
>>or TIMESTAMP) column and xoops is keeping the date in an INTEGER column
>>in Unix timestamp format.
>>
>>If both of those are true then you can easily convert from one or the
>>other using the |FROM_UNIXTIME() or ||UNIX_TIMESTAMP() functions.
>>
>>    
>>
>>>I am testing moving from a phpnuke site to a xoops site.  In doing so, I
>>>am trying to get the user table moved over.
>>>
>>>I see in the phpnuke tables (which a similar table exists in xoops) that
>>>the users have a sign up date.  The date in phpnuke is the calendar day,
>>>May 1, 2004, for example.  In xoops, it is seconds since 1-1-1970.
>>>
>>>Is there a way to convert all 24K+ users from the day to the second
>>>format?
>>>
>>>And, if not, would it be possible to zero out or empty the records?  And,
>>>what are the ramifications of doing so?  (The most important to us is the
>>>ability to keep username, email, and password.)
>>>      
>>>
>
>  
>

Thread
Using epoch date instead of calendar dateEric Wagar29 Nov
  • Re: Using epoch date instead of calendar dateChris29 Nov
    • Re: Using epoch date instead of calendar dateEric Wagar29 Nov
      • Re: Using epoch date instead of calendar dateChris29 Nov
        • about berkeley db黄 俊源29 Nov
          • Re: about berkeley dbDan Nelson29 Nov
  • Re: Using epoch date instead of calendar dateDan Nelson29 Nov
    • Re: Using epoch date instead of calendar dateEric Wagar29 Nov