playMaker

Author Topic: Getting a month to string from Get System DateTime  (Read 452 times)

IvanArbusto

  • Playmaker Newbie
  • *
  • Posts: 2
Getting a month to string from Get System DateTime
« on: January 19, 2022, 10:48:50 AM »
Hey guys, I'm new to Playmaker and I was wondering if I can get the current month converted to a string variable to implement some seasonal events in my game.

I was able to use the Get System DateTime action, and then create a substring with the first two digits, thus, getting the month to string. (yay!)

However, I don't know if this format would be culture sensitive when checking DateTime on a device or if it would be always in this default format.

For example, I'm from Brazil, where the format is like dd-MM-yy. Anyhow, when I used DateTime action it returned the default format (MM-dd-yy).

I need only the month to string, so, in short, can I use this action to get DateTime (and it's going to return in this format, no matter what?). Because if the device returns a different format I would get the day instead of the month (by sending the first two digits to a substring).

Any thoughts?
« Last Edit: January 19, 2022, 10:50:58 AM by IvanArbusto »

IvanArbusto

  • Playmaker Newbie
  • *
  • Posts: 2
Re: Getting a month to string from Get System DateTime
« Reply #1 on: January 20, 2022, 02:03:12 PM »
OK so I tweaked a little more on the Get system dateTime action and I think I understand how the formatting works... If I don't enable the formating it will get my (culture sensitive) dateTime which, in fact I tested and it was dd/MM/yyyy HH:mm (as it was supposed to be cause I'm in Brazil). Then, I tested formating it to get this same format, enabling the format and editing its field as dd/MM/yyyy HH:mm and it also worked.
I think I can be sure now that if I set the dateTime to default (which is what I want) which formats like MM/dd/yyyy HH:mm then every device everywhere will get its dateTime and format like this. Then my game will be able to extract this as a substring with the MM digits. Problem solved, is that right?
« Last Edit: January 20, 2022, 02:06:59 PM by IvanArbusto »