Skip to content

Instantly share code, notes, and snippets.

@jpalala
Created October 15, 2011 04:14
Show Gist options
  • Save jpalala/1289032 to your computer and use it in GitHub Desktop.
Save jpalala/1289032 to your computer and use it in GitHub Desktop.
Tells the time from a CET (Europe Time) to my Philippine Time
#!/usr/bin/python
from time import localtime,gmtime, strftime
from datetime import date
import datetime
import os
#public static void main argzzz {{{ :D
x = int(strftime("%Y"))
m = int(strftime("%m"))
d = int(strftime("%d"))
h = int(strftime("%H")) + 6
if(h > 17):
h = h % 24
if(h>12):
h2 = h % 12
else:
h2 = h
else:
pass
minute = strftime("%M")
date = datetime.date(x,m,d)
today = date.weekday()
print "Today is" , (datetime.date(2011,m,d)) ,
print today
if h > 12:
print "The time is %s:%sPM" % (h2,minute)
else:
print "The time is %s:%sAM" % (h, minute)
if(today == 0):
print "MONDAY"
elif(today == 1):
print "TUESDAY"
elif(today == 2):
print "WEDNESDAY"
elif(today == 3):
print "THURSDAY"
elif(today == 4):
print "FRIDAY"
elif(today == 5):
print "SATURDAY"
else:
print "SUNDAY"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment