OJS OCS OMP OHS

You are viewing the PKP Support Forum | PKP Home Wiki



24h time system

Are you responsible for making OCS work -- installing, upgrading, migrating or troubleshooting? Do you think you've found a bug? Post in this forum.

Moderators: jmacgreg, michael, John

Forum rules
What to do if you have a technical problem with OCS:

1. Search the forum. You can do this from the Advanced Search Page or from our Google Custom Search, which will search the entire PKP site. If you are encountering an error, we especially recommend searching the forum for said error.

2. Check the FAQ to see if your question or error has already been resolved. Please note that this FAQ is OJS-centric, but most issues are applicable to both platforms.

3. Post a question, but please, only after trying the above two solutions. If it's a workflow or usability question you should probably post to the OCS Conference Support and Discussion subforum; if you have a development question, try the OCS Development subforum.

24h time system

Postby mendesrocha » Mon Sep 08, 2008 7:16 pm

Hello!

Is it possible to have 24 hour time system instead of the standard 12h-AM/PM system used in the OCS?

If yes, please, how can I set it?

Thanks,
Renato
mendesrocha
 
Posts: 174
Joined: Mon Nov 05, 2007 11:10 am
Location: Brazil

Re: 24h time system

Postby jmacgreg » Mon Sep 08, 2008 8:35 pm

Hi Renato,

You should be able to change to a 24h time system by editing config.inc.php's short and long date formats under General Settings. The part you will want to edit looks like this:

Code: Select all
; Short and long date formats
date_format_trunc = "%m-%d"
date_format_short = "%Y-%m-%d"
date_format_long = "%B %e, %Y"
datetime_format_short = "%Y-%m-%d %I:%M %p"
datetime_format_long = "%B %e, %Y - %I:%M %p"
time_format = "%I:%M %p"



Variables and their explanations can be found here: http://ca3.php.net/strftime.
jmacgreg
 
Posts: 4190
Joined: Tue Feb 14, 2006 10:50 am

Re: 24h time system

Postby mendesrocha » Tue Sep 09, 2008 6:43 am

Hello James,

Thanks for your information.

I changed the date format on the config.inc.php from

Code: Select all
datetime_format_short = "%Y-%m-%d %I:%M %p"
datetime_format_long = "%B %e, %Y - %I:%M %p"
time_format = "%I:%M %p"


to

Code: Select all
datetime_format_short = "%d-%m-%Y %H:%M"
datetime_format_long = "%B %e, %Y - %H:%M"
time_format = "%H:%M"


but it takes no effect on the Scheduler Manager.

When I am going to schedule the presentatins I still got the 12h-AM/PM system.

Renato
mendesrocha
 
Posts: 174
Joined: Mon Nov 05, 2007 11:10 am
Location: Brazil

Re: 24h time system

Postby jmacgreg » Tue Sep 09, 2008 11:25 am

Hi Renato,

Apologies, I overlooked the fact that in some cases you will need to edit the template itself. For the scheduler for example, you will have to open the file templates/manager/scheduler/specialEventsForm.tpl; find any instance of 'use_24_hours=false'; and change to 'use_24_hours=true'. To change for your entire system you will want to do a search and replace for that snippet against the entire codebase, and of course you will want to keep track of your changes if/when you upgrade.

Cheers,
James
jmacgreg
 
Posts: 4190
Joined: Tue Feb 14, 2006 10:50 am

Re: 24h time system

Postby ramon » Wed Nov 10, 2010 5:30 am

Hello all,
I'm not sure if I should post this here.
I may eventually do the worst thing in forums and cross-post (here) just to reinforce the point.
The point is that date-time configurations should be defined by language.
This means that a single option to define the formats is not enough for a multilingual system.
I believe the simplest way to do this is to create separate config files for languages, loaded when language changes (maybe even created on-the-fly after installation) and a general config file with the basics.
Then, the administrator would have a new option to configure each option for each language.
I think this makes more sense, although not sure how or if it will/should be implemented.
The date-time config may also be implemented as a Pluing, if possible...
ramon
 
Posts: 940
Joined: Wed Oct 15, 2003 6:15 am
Location: Brasí­lia/DF - Brasil


Return to OCS Technical Support

Who is online

Users browsing this forum: No registered users and 3 guests