#1
| |||
| |||
Date function in PHP The management of dates in PHP is very simple. the function date (). We then see the time () and mktime (). Function date () The function date () is used in different ways. It always returns a string corresponding to what he had requested (it may be the time, day, month, etc. ). Attention, the parameters correspond to those returned from the server, if your server has a disorderly hours, the function date () does not return correct time. Example to view the current year with the function date (): PHP Code: If you want to display the months and years, you could do this: PHP Code: PHP Code: |
#2
| |||
| |||
Re: Date function in PHP PHP timestamp A timestamp is a number that indicates the number of seconds that have elapsed since the first in January 1970. The first in January 1970 to midnight, the timestamp was 0. It now holds 10 numbers, ie if the number of seconds that have elapsed since is important! To display the timestamp of the second present, it uses time () function of PHP. Here's an example: PHP Code: PHP Code: PHP Code: |
#3
| |||
| |||
Re: Date function in PHP Conversions from one date to a timestamp PHP allows you to convert a date to a timestamp. To do this, we use the function mktime (). It will allow the date, time, etc ... a classic date, to obtain the corresponding timestamp. This timestamp can then be stored or further processing. Here is the basic syntax of the function mktime (): PHP Code: PHP Code: |
![]() |
|
Tags: date, php |
Thread Tools | Search this Thread |
|
![]() | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Sql query for Date function. | horuy | Software Development | 3 | 17-11-2010 12:22 AM |
Discussion of Date and Time function | Gerri | Software Development | 3 | 29-01-2010 12:03 PM |
Date function in php including milliseconds | hamX15 | Software Development | 3 | 22-06-2009 02:53 PM |
MySQL date & time function. | Amaresh | Software Development | 2 | 19-06-2009 02:49 PM |
Problem with Php date function | HAMAKO | Software Development | 1 | 21-04-2009 12:38 PM |