Unknown delimiter for StrSplit

The 1C:Enterprise developers forum

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

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: 4
Joined: Mar 6, 2018
Company: Bodega LLC

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
Interested
Rating: 16
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
Users browsing this topic (guests: 1, registered: 0, hidden: 0)
Be the first to know tips & tricks on business application development!

A confirmation e-mail has been sent to the e-mail address you provided .

Click the link in the e-mail to confirm and activate the subscription.