Hi i would like to strip a Date() so that i can get the day,Hour, Min, Sec format into a variable called $day, $Hour, $Min, $Sec.
Only problem i got is i dont know really how to strip it into parts and put the selected parts into variables.
//Thanks in advance
//Thomas
Strip Date() to Days, Hours, Min, Sec
Moderator: General Moderators
- akuji36
- Forum Contributor
- Posts: 190
- Joined: Tue Oct 14, 2008 9:53 am
- Location: Hartford, Connecticut
Re: Strip Date() to Days, Hours, Min, Sec
I think you want something like this:
http://www.actionscript.org/forums/show ... p3?t=40237
thanks
Rod
http://www.actionscript.org/forums/show ... p3?t=40237
thanks
Rod
Re: Strip Date() to Days, Hours, Min, Sec
Well i didnt understand alot about that so correct me if it where what i were looking for.
But ill try explaining again.
$time=date(day, hour, min, sec);
(strip ($time)) //somehow...
get the days, hours, min and sec as following:
Put the value of Days into variable $Day
Put the value of Hours into variable $Hour
Put the value of Mins into variable $Min
Put the value of Secs into variable $Sec
so that i can use the variables.
//Thanks in advance
//Thomas
But ill try explaining again.
$time=date(day, hour, min, sec);
(strip ($time)) //somehow...
get the days, hours, min and sec as following:
Put the value of Days into variable $Day
Put the value of Hours into variable $Hour
Put the value of Mins into variable $Min
Put the value of Secs into variable $Sec
so that i can use the variables.
//Thanks in advance
//Thomas
Re: Strip Date() to Days, Hours, Min, Sec
Code: Select all
list($day,$month,$year,$hour,$minutes,$seconds) = explode('/',date('d/m/y/h/i/s'));Real programmers don't comment their code. If it was hard to write, it should be hard to understand.
- akuji36
- Forum Contributor
- Posts: 190
- Joined: Tue Oct 14, 2008 9:53 am
- Location: Hartford, Connecticut
Re: Strip Date() to Days, Hours, Min, Sec
You want something like this:
Using the php date function:
l = Day of the week
F= Month
j= day of month in number format: example 1st, 2nd, or 24 day of month
Y= year
h= hour
i=minutes
s=seconds
a= Am or Pm
the ":" are for formatting purposes.
Find more on use of the date function here:
http://php.about.com/od/learnphp/ss/php_functions_3.htm
thanks
Rod
Code: Select all
<?php echo date("l"); ?>  
<?php echo date("F j, Y"); ?>  
<?php
echo date("h:i:s a");
?>
l = Day of the week
F= Month
j= day of month in number format: example 1st, 2nd, or 24 day of month
Y= year
h= hour
i=minutes
s=seconds
a= Am or Pm
the ":" are for formatting purposes.
Find more on use of the date function here:
http://php.about.com/od/learnphp/ss/php_functions_3.htm
thanks
Rod
Last edited by pickle on Wed Mar 10, 2010 10:13 am, edited 1 time in total.
Reason: Fixing broken [code] tag
Reason: Fixing broken [code] tag
Re: Strip Date() to Days, Hours, Min, Sec
Hi rod!
Well not exacly... but the basics is correct i wanted those l m y and such as into variables...
so that the l m y and such as becomes $l $m $y... =)
Well not exacly... but the basics is correct i wanted those l m y and such as into variables...
so that the l m y and such as becomes $l $m $y... =)
Re: Strip Date() to Days, Hours, Min, Sec
ohh sorry Rod didnt see pickle wrote 
Pickle u found what i were looking for thank you so much!
Pickle u found what i were looking for thank you so much!