Quickies

[categories] [index] [all (527)] [latest]

Python
  1. import locale
    import datetime
    
    locale.setlocale(locale.LC_ALL, 'fr_FR')
    now = datetime.datetime.now()
    now.strftime("%A %d %B %Y, %H:%M")
    #'Samedi 20 janvier 2007, 15:17'
    

    Another way:

    from time import strftime
    strftime("%Y-%m-%d %H:%M:%S")
    #'2008-09-28 20:33:09'