Skip to content
Advertisement

Tag: time

Get previous week number from php week number

I currently need to get the previous week from a variable that passes a php week number so if it is week 13 I will get week 12. The problem I am facing is that if I just minus 1 from the original number if I am in week 1 it will return week 0 unless I create an if

PHP get UK local time from Server in different time zone

I have a web server which I do not know what the time zone is set to. it is now 10:49am in the UK, but when I run the following: The server returns the following time. Now I don’t want to just “Add” one hour onto the time because the time still needs to be correct when time moves forward

Adding 1 hour to time variable

I have a time to which I want to add an hour: I’ve tried: But none of the above work. Answer Worked for me.. Explanation: strtotime(’10:09′) creates a numerical timestamp in seconds, something like 1510450372. Simply add or remove the amount of seconds you need and use date() to convert it back into a human readable format. time() also creates

PHP Time() to Google Calendar Dates time format

I have PHP times for the start and end times of an event. This is a simple <?php time(); ?> for some future date’s start and end time. I was wondering if anyone knew of a way to take either the numerical format (PHP time()) or taking some string value representing that time (I could do a strtotime($sometimevalue);) and turn

Advertisement