www.dilella.org

“the only source of knowledge is experience” – Albert Einstein

Archive for June, 2008

python datetime 2 unixdatetime

The problem when you use mktime is that it converts your python datetime (with/without dst) to your localtime. But if you want to convert it only to a normal unixdatetime without tz you need to create an own function. Here is an example that Ive used for a project:

def dt2ut(date):
    total = ((date.year-1970)*365) + int(float((date.year-1970))/4.0)
    monthdays=[31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31]
    for i in range(1,date.month):
        total = total + monthdays[i-1]
    total = total + date.day
    total = total*86400 + 3600*date.hour + 60*date.minute + date.second + 1e-6*date.microsecond
    return int(total*100)*10

  • Share/Bookmark
  • 0 Comments
  • Filed under: Coding
  • fonie, maybe the skype-ng ?

    myfonie.gifWhile surfing around and reading news I discovered an interesting project named fonie. To make it short it offers an voice tel within your browser. You dont need to install a plugin or other software. From the technology part what are they doing ? Fonie.de is using adobe flash to grant access to your microphone and webcam for their webbrowser video-telephony.
    If you want to test it just visit their homepage and start a new call. You will receive a link that you can send to your friend … The sound quality is not the best but I believe that this will be changed soon if a big Investor will help them ;)

    • Share/Bookmark
  • 0 Comments
  • Filed under: Tools, foo