Time format on saveslots
Forum rules
This is the right place for Ren'Py help. Please ask one question per thread, use a descriptive subject like 'NotFound error in option.rpy' , and include all the relevant information - especially any relevant code and traceback messages. Use the code tag to format scripts.
This is the right place for Ren'Py help. Please ask one question per thread, use a descriptive subject like 'NotFound error in option.rpy' , and include all the relevant information - especially any relevant code and traceback messages. Use the code tag to format scripts.
- Karrion
- Regular
- Posts: 73
- Joined: Fri Jan 18, 2019 8:33 pm
- Projects: Murder on the Marine Express
- Organization: 1564 Studio
- itch: 1564-studio
- Contact:
Time format on saveslots
I want to have the time in the saveslots as the format "MON 16.11.1952", however I can't find anywhere in the documentation how can I put the day in uppercase and just the first 3 letters (I tried using !u as it said it could force uppercase and didn't work), or how can I put the month in number instead of letters. Any help is appreciated.
- namastaii
- Eileen-Class Veteran
- Posts: 1350
- Joined: Mon Feb 02, 2015 8:35 pm
- Projects: Template Maker for Ren'Py, What Life
- Github: lunalucid
- Skype: Discord: lunalucid#1991
- Soundcloud: LunaLucidMusic
- itch: lunalucid
- Location: USA
- Contact:
Re: Time format on saveslots
In screens.py under screen file_slots change this line to this (it's on line 648 if you haven't added anything to this page)
%a changes it to the short version of the month and put periods in between the month, day, year, also changing it to %m for the month number version. Here's a reference for these https://www.w3schools.com/python/python_datetime.asp
Though, I'm not sure the best way to make the weekday all caps. I don't think renpy already has certain libraries you'd use for this? I tried .upper() as well and it didn't seem to change it. Maybe someone else has a suggestion. Though, if you're willing and it's important enough, you can do some extra steps to make this happen but this code I wrote up gives this outcome: Also, you can easily remove the commas if you wanted it to look just like your example which doesn't include those.
Code: Select all
text FileTime(slot, format=_("{#file_time}%a, %m.%d.%Y, %H:%M"), empty=_("empty slot")):
Though, I'm not sure the best way to make the weekday all caps. I don't think renpy already has certain libraries you'd use for this? I tried .upper() as well and it didn't seem to change it. Maybe someone else has a suggestion. Though, if you're willing and it's important enough, you can do some extra steps to make this happen but this code I wrote up gives this outcome: Also, you can easily remove the commas if you wanted it to look just like your example which doesn't include those.
- Karrion
- Regular
- Posts: 73
- Joined: Fri Jan 18, 2019 8:33 pm
- Projects: Murder on the Marine Express
- Organization: 1564 Studio
- itch: 1564-studio
- Contact:
Re: Time format on saveslots
Ah, yes, thank you! I was looking for format options and couldn't find anything in the ren'py documentation. The all-caps thing is not important so we'll just leave it as-is.
- namastaii
- Eileen-Class Veteran
- Posts: 1350
- Joined: Mon Feb 02, 2015 8:35 pm
- Projects: Template Maker for Ren'Py, What Life
- Github: lunalucid
- Skype: Discord: lunalucid#1991
- Soundcloud: LunaLucidMusic
- itch: lunalucid
- Location: USA
- Contact:
Re: Time format on saveslots
Yeah anything with stuff like this, you might find more info by looking up python documentation since this just has to do with time formatting in python
Who is online
Users browsing this forum: bonnie_641