AsDateTime function but not using regional format?

Hi, currently when I use the AsDateTime function it returns date and time using regional formatting (I’m assuming based on Windows region settings), so it’s returning me “17 de Jan de 2022 13:22:00” or close to that.

However this is a problem since I’ll have the date and time in a fixed size box, and I can’t account for the widest date possible for every region to size my box, so I wanted my date time to be displayed in a specific format, something more international such as “Jan 17, 2022 01:22:00 PM”.

Currently I made a custom formatting function:

But this is far from ideal since it requires execution pins, and I also need to copy the function to every blueprint that needs it, while AsDateTime can be accessed globally, with no need for execution pins.

Is it possible to have the AsDateTime function to display my date time in another format? or is there another function for that?

Alternatively, can I remove the need for execution pins in my custom function? Can I also make it globally available to any blueprints?

You can make functions pure, this removes the execution pin. You can also use the Select node to avoid unnecessary execution wires.

Can I also make it globally available to any blueprints?

Yup, you’re after blueprint function libraries:

Right! that’s it. I didn’t really know I could make functions pure, or have a custom library. This is what I ended up with:

Thanks

1 Like