Get day of week

I have a process in which I have to obtain the day of the week (in Spanish) and if it is Monday, subtract 3 days.

How can I do it?

I have this code

weekDay(string)= culture.DateTimeFormat.GetDayName(now.DayOfWeek).ToString

But it’s giving me an error.

I have created the culture variable of type CultureInfo

But when I execute it I get the error “Object reference not set an instance of an object”

What am I doing wrong?

try Now.DayOfWeek.ToString()

Hi @Marisa_Ontiveros1

Can you try the below

If(New System.Globalization.CultureInfo("es-ES").DateTimeFormat.GetDayName(Now.DayOfWeek).ToLower() = "lunes", Now.AddDays(-3), Now)

Regards,

1 Like

Hey @Marisa_Ontiveros1

Make a use of Modify date activity :

(Activities - Modify Date)

Given video link below for your references

(https://youtu.be/SlIqfo9D5no?si=Mvs63eSfViySMeWu)

Cheers :upside_down_face:

Lets divide and conquer

Getting a day name in Spanish
grafik

Subtracting 3 days
yourDateTimeVar.AddDays(-3)

But we feel that we dont need to check the spanisch name, when processing the date. Maybe you can elaborate more on this and the overall goal

maybe you are looking for this:

myDate = Wednesday:
grafik

myDate = Monday
grafik

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.