DateTime conversion function using PHP

It’s really very simple to convert times in different timezones using the following function. [code lang=”php”] function dateTimeConversion($datetime, $timezone=”Europe/London”) { $date = new DateTime($datetime, new DateTimeZone(“UTC”)); $date->setTimezone($timezone); return $date->format(“Y-m-d H:i:s”); } [/code] As you can see, it takes 2 arguments, $datetime which is a time string and a $timezone which Read more…

By Andrew Odendaal, ago

Add a date to a date in Actionscript 2

I needed to work out a date range according to the date 3weeks away from the current date. After a bit of thinking, I found that it’s actually quite easy to achieve. [code lang=”actionscript”] var theDate:Date = new Date(); dateDay = theDate.getDate(); dateMonth = theDate.getMonth(); dateYear = theDate.getFullYear(); var theDate2:Date Read more…

By Andrew Odendaal, ago