Yii Framework Forum: Datefield And Date Format Problem - Yii Framework Forum

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

Datefield And Date Format Problem Rate Topic: -----

#1 User is offline   Slacki 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 1
  • Joined: 11-November 13

Posted 19 November 2013 - 11:24 AM

Hi guys, it is my first post, so hello! :)

I am wirting an application now, and i am in this stage, when i need to get date from user by form. I used built-in solution provided by Yii, as in topic: dateField.
Default it gather date and provide it in yyyy-mm-dd format. My question is how can i convert this date to unix timestamp, and how should i provide the data to the form, when user is editing it (convert from unix timestamp to yyyy-mm-dd)?

Why i need to do that? Hm, i just took convention like that, and i am storing all by time/date as unix timestaps.

PS. Sorry for my English.
0

#2 User is offline   ORey 

  • Elite Member
  • PipPipPipPipPip
  • Yii
  • Group: Members
  • Posts: 1,695
  • Joined: 20-April 09
  • Location:Moscow, Russia

Posted 19 November 2013 - 11:30 AM

View PostSlacki, on 19 November 2013 - 11:24 AM, said:

My question is how can i convert this date to unix timestamp, and how should i provide the data to the form, when user is editing it (convert from unix timestamp to yyyy-mm-dd)?


That's a general PHP question. Plz read php manual about existing date/time functions.

Also:
http://www.yiiframew...tamp&type=forum

http://www.yiiframew...__1#entry228402
God is real unless declared as integer
0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users