Generating a drop down list of timezones with PHP

I would do it in PHP, except I would avoid doing preg_match 100 some times and do this to generate your list. $tzlist = DateTimeZone::listIdentifiers(DateTimeZone::ALL); Also, I would use PHP’s names for the ‘timezones’ and forget about GMT offsets, which will change based on DST. Code like that in phpbb is only that way b/c … Read more

Convert python datetime to epoch with strftime

If you want to convert a python datetime to seconds since epoch you could do it explicitly: >>> (datetime.datetime(2012,4,1,0,0) – datetime.datetime(1970,1,1)).total_seconds() 1333238400.0 In Python 3.3+ you can use timestamp() instead: >>> datetime.datetime(2012,4,1,0,0).timestamp() 1333234800.0 Why you should not use datetime.strftime(‘%s’) Python doesn’t actually support %s as an argument to strftime (if you check at http://docs.python.org/library/datetime.html#strftime-and-strptime-behavior it’s … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)