Getting the day of the week?

It seems the get day of the week function is still only in C++, and using that for my project is out of the question. How can I do this in Blueprints?

Why is C++ out of the question? A simple generated BlueprintFunctionLibrary, one line of code and a switch is all you need. Otherwise you should search for a plugin but seems like overkill to me.

You say this, but is it as simple as adding this one line of code into the console? To enter even one line of code converts a blueprint project into a C++ project and there is no going back. I tried this on my project, as someone suggested, oh, just add this one line of code. Well, it didn’t work, my project wouldn’t compile or do anything, and now it was a C++ project and I was screwed. Took me days to get back to where I was from a backup cause, yeah, I was dumb and didn’t realize I didn’t backup before attempting this. So, my suggestion is, if you don’t know C++, don’t have access to a programmer then stick with BP unless you seriously HAVE to convert to C++ to create a feature you need. I don’t see why a plugin is over kill if it keeps me from turning my project into a C++ project. Just my 2 cents and my experience.

In this case it is very few lines, could probably be done in one. I wouldn’t be afraid of trying to switch to c++ if you make a back first in case it screws up. Its easier than most people think and there’s plenty of tutorials. I’d try it after making sure you won’t lose progress if you decide to revert.

You can always implement a BP function to calculate it. This is my implementation of the Tomohiko Sakamoto algorithm:

Function:

Usage:

The day of the week will be from 0 to 6, with 0 as Sunday, 1 as Monday and so on.

1 Like

Thank you so much!