Unknown delimiter for StrSplit


If you wish to leave comments or ask questions, please log on or sign up.

The 1C:Enterprise developers forum

#1
People who like this:0Yes/0No
Active user
Rating: 3
Joined: Mar 6, 2018
Company:

Hello!

I have a problem with date to string coversion;

Code
y = year(CurrentDate);
z = String(y);


"z" can be "2,018" or "2 018" or "2.018" according to regional settings...

Every client have different settings, is there any way to solve this?

 
#2
People who like this:0Yes/0No
Active user
Rating: 3
Joined: Mar 6, 2018
Company:

I found this way;

Code
ch = Left(Right(z,4),1);

with this way i can get 2nd character what ever its.

 
#3
People who like this:0Yes/0No
Just came
Rating: 0
Joined: Jun 10, 2016
Company:

Try to use this:
y = year(CurrentDate);
z = Format(y, "NG=");

 
#4
People who like this:0Yes/0No
Administrator
Rating: 19
Joined: Dec 4, 2017
Company:

Dear eyup yilmaz,

Sergey provided an appropriate example for you as using the Format() function is a correct way to get date and time in the format you need.

Best regards,
Vladimir Gurov

1C Company support team
 
Subscribe