These forums were permanently set to read-only mode on July 20, 2022. From that day onwards, no new posting or comment is allowed on the site, but the historical content remains intact and searchable.

A new location for posting questions about PlanetPress Suite is now available:

OL Learn - PlanetPress Classic (opens in new tab)

Topic Options
#54443 - 01/04/17 10:36 AM Automatic change of local DATE function problem
Marko Offline
OL Newbie

Registered: 01/04/17
Posts: 2
Hello everyone,

For a long time I have one problem that I’m thinkering aound but couldn’t find solution.

I need to change Variable result for Date, based on source from Excell.

I figured out how to change format, but for long version ( e.g. 1 Januar 1999 ) month is fixed to language that is selected by function. I also know that date format is changing depending on local code selected.

This is what I have now, unfortunately name of month is not changing (it stays in local selected for DATE function), just format changes.
IF([Sp]="1",DATE([Geburtsdatum],"d. mmmm yyyy"),"")&IF([Sp]="2",DATE([Geburtsdatum],"d mmmm yyyy"),"")&IF([Sp]="3",DATE([Geburtsdatum],"d mmmm yyyy"),"")

Example of excell data would be:
SP; Name; DOB;
1; John; 19990101;
2; Mathew; 19800101;
3; Stefan; 19700101;

SP=language (1-English, 2-French, 3-German), DOB=Date of Birth

Result variable should look like:
January 1, 1999

1 janvier 1980

1. Januar 1970

Does anyone know is this possible to do automaticaly by defining in function/script?

Many helps for advice or solution,

#54445 - 01/04/17 12:01 PM Re: Automatic change of local DATE function problem [Re: Marko]
Jean-Cédric Offline
OL Expert

Registered: 10/03/16
Posts: 681
Loc: Québec, Canada
Unfortunately, PSM does depends of the local settings. What you have to do is using the IF[] command and set the false value to another IF commands and so on and that for every language take can be used.
Then stack all those variables on top of another and execute them when required.

Hope that helps.
99 frigging bugs in my code
99 frigging bugs
Take one down
Code around
127 frigging bugs in my code

#54447 - 01/05/17 07:47 AM Re: Automatic change of local DATE function problem [Re: Jean-Cédric]
Marko Offline
OL Newbie

Registered: 01/04/17
Posts: 2
Hey Jean-Cédric

thank you so much for your input. I solved the problem with 3 variables and IF commands.

Thank you for the tip