Jump to content
php.lv forumi

MSSQL datums


dAivEd

Recommended Posts

Sveiks,

Vari mēģināt šo stringu palaist caur strtotime un tad ar date('d m y', timestamp)

 

Pameginaaju shita:

 

$date_end = date('d m y', strtotime($siege_end_date ) );

$siege_end_date - ir tieshi tas datums kuru es uzrakstiju augstak

Raada "01 01 70", taatad nesanaaca diemzhel, vel idejas ir ?

Edited by dAivEd
Link to comment
Share on other sites

es parasti izmantoju select unix_timestamp(mysql_datetime_kolonna) un tad ar php formatēju kā parasto timestampu

 

protams, tas ir viens no entajiem variantiem, nianses sākas ar timezonām, bet tas diezvai te ir svarīgi

Edited by Mr.Key
Link to comment
Share on other sites

Pameginaaju shita:

 

$date_end = date('d m y', strtotime($siege_end_date ) );

 

$siege_end_date - ir tieshi tas datums kuru es uzrakstiju augstak

Raada "01 01 70", taatad nesanaaca diemzhel, vel idejas ir ?

Tātad $siege_end_date atgrieza nulli, 01 01 70 ir Unix ēras sākums, kad time()=0

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...