Author Topic: Date variable  (Read 102 times)


PHP Help Forum

Date variable
« on: May 19, 2017, 02:42:06 am »


daveismyname

  • Senior Member
  • ****
  • Posts: 314
  • Karma: 8
  • PHP Helper
    • View Profile
    • Personal Blog and Tutorial
Since you want an extract date you can just hardcore it

1
2
3
 
 $myDate 
'2001-01-31';
 



For dynamic dates you can use the date function

1
2
3
 
 $today 
date('Y-m-d');
 

« Last Edit: May 19, 2017, 03:00:36 am by daveismyname »

PHP Help Forum

Re: Date variable
« Reply #1 on: May 19, 2017, 02:58:48 am »



PHP Help Forum

Re: Date variable
« Reply #2 on: May 19, 2017, 05:26:24 pm »


Baby_Bean

  • Regular Member
  • **
  • Posts: 35
  • Karma: 0
    • View Profile
Since you want an extract date you can just hardcore it

1
2
3
 
 $myDate 
'2001-01-31';
 



For dynamic dates you can use the date function

1
2
3
 
 $today 
date('Y-m-d');
 


Thanks a lot Dave

PHP Help Forum

Re: Date variable
« Reply #3 on: May 20, 2017, 05:08:56 am »


Baby_Bean

  • Regular Member
  • **
  • Posts: 35
  • Karma: 0
    • View Profile
Hi,

Eventually, this can help too, should you wish to try other formats, just scroll down to ,,Example #4 date() Formatting,,:
http://php.net/manual/en/function.date.php
Thanks a lot Clusteer_one

PHP Help Forum

Re: Date variable
« Reply #4 on: May 20, 2017, 05:19:27 am »