[ create a new paste ] login | about

Link: http://codepad.org/WTwUnfKJ    [ raw code | output | fork ]

martin@mustbebuilt.co.uk - PHP, pasted on Oct 23:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
<?php
$currentTime = time();
echo "$currentTime\n";
$mydate = mktime(1,30,50,12,13,1971);
echo "$mydate\n";
//outputs 61435850 the number of seconds since 1 January 1970
$mydate = strtotime("23 OCTOBER 2014");
echo "$mydate\n";
$mydate = mktime(1,30,50,12,13,1971);
echo "$mydate\n";
$today = getdate();
print_r($today);
$mydate = strtotime("1/31/80");
echo date("D d M Y", $mydate);  //  outputs Thu 31 Jan 1980
$mydatetest2 = mktime(1,30,50,12,25,1986);
echo strftime("%d %B %Y", $mydatetest2);
?>


Output:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
1414051154
61435850
1414022400
61435850
Array
(
    [seconds] => 14
    [minutes] => 59
    [hours] => 7
    [mday] => 23
    [wday] => 4
    [mon] => 10
    [year] => 2014
    [yday] => 295
    [weekday] => Thursday
    [month] => October
    [0] => 1414051154
)
Thu 31 Jan 198025 December 1986


Create a new paste based on this one


Comments: