0

I have question about time. How to custom output time?

'Sat Dec 03 08:38:34 2016'

But I want to do something like this for example, Sat will become Sabtu, Dec become Desember or more like this

Sabtu, 03 Desember 2016, jam 08:34:34
mcmxl
  • 93
  • 1
  • 2
  • 8
Elonelon
  • 68
  • 1
  • 12
  • The simplest way would be just replace the strings with what you want, a bit like `d = 'Sat Dec 06'`, `d = d.replace('Sat', 'Sabtu')`, `d = d.replace('Dec', 'Desember')`, etc, you'd do it for each day and month. – Peter Dec 03 '16 at 01:50
  • @Peter Sure, that works for this one example. What about all other months and days? – OneCricketeer Dec 03 '16 at 01:52
  • 1
    http://stackoverflow.com/questions/985505/locale-date-formatting-in-python – furas Dec 03 '16 at 01:52
  • 1
    Also http://stackoverflow.com/questions/18593661/how-do-i-strftime-a-date-object-in-a-different-locale#24070673 – OneCricketeer Dec 03 '16 at 01:52
  • @Peter, thanks, but how about the another day ?? – Elonelon Dec 03 '16 at 02:12
  • I just meant repeat what I did for every day/month, such as `d = d.replace('Mon', 'day1')`, `d = d.replace('Tue', 'day2')`, `d = d.replace('Jan', 'month1'), `d = d.replace('Feb', 'month2')`, etc :P I thought you were making up a language though to be fair, though google translate says that's indonesian, so follow those links above if you are – Peter Dec 04 '16 at 03:26

0 Answers0