change from the Ilogic programming the date format

change from the Ilogic programming the date format

Miguel.CarvajalS34Q6
Advocate Advocate
2,447 Views
5 Replies
Message 1 of 6

change from the Ilogic programming the date format

Miguel.CarvajalS34Q6
Advocate
Advocate

the output format of the date is required to be different.
but it cannot be adjusted from windows, it is necessary to change it from inventor using Ilogic.

from windows the format is MONTH/DAY/YEAR, and you want to leave it YEAR/MONTH/DAY

0 Likes
Accepted solutions (3)
2,448 Views
5 Replies
Replies (5)
Message 2 of 6

A.Acheson
Mentor
Mentor
Accepted solution

You could use some ilogic to change the format see post1

And here is the format in windows help for formatting  dates.

 

An example

 

DateTime.Now.ToString("yyyyMMdd”)

 

If this solved a problem, please click (accept) as solution.‌‌‌‌
Or if this helped you, please, click (like)‌‌
Regards
Alan
0 Likes
Message 3 of 6

Miguel.CarvajalS34Q6
Advocate
Advocate

thanks, but the code does not work, it must be some restiction that windows has

0 Likes
Message 4 of 6

A.Acheson
Mentor
Mentor
Accepted solution

It works for me to create a string. Can you show how you implemented it's use?

AAcheson_0-1649123518996.png

 

If this solved a problem, please click (accept) as solution.‌‌‌‌
Or if this helped you, please, click (like)‌‌
Regards
Alan
0 Likes
Message 5 of 6

Miguel.CarvajalS34Q6
Advocate
Advocate

In a few words, what I need is to change the format of the date, whether it is a property of the project, of the status or custom, change the output format of the dates.

0 Likes
Message 6 of 6

A.Acheson
Mentor
Mentor
Accepted solution

So by your latest request to have existing date string that maybe not the DateNow the task gets more difficult. You will need to research and use a function to read the incoming date string, determine the culture/region it belongs too and then convert to your preferred format. This is a difficult task as I found in my testing. If you want to marked this post as not solved you might get more experienced eyes on the problem your facing. Here is a post that shows how to convert a string to date, I hope it is helpful. 

If this solved a problem, please click (accept) as solution.‌‌‌‌
Or if this helped you, please, click (like)‌‌
Regards
Alan