How to make {calendar_start_date} return date in EU format?

Knightmare00

New member
I am trying to use magic text {calendar_start_date} but it returns the date in US format M/D/YY eg 8/17/23, same as {calendar_start_date_us}

I would like {calendar_start_date} to return the date in EU format DD/MM/YY eg 17/08/23 or even better in DAY, DD/MM/YY. Can anyone help?
 

Dimlos

Well-known member
You can use the shell script date command without using magic text to get output in your preferred format.
 

Attachments

  • date_format.jpg
    date_format.jpg
    479 KB · Views: 20

Knightmare00

New member
I'm a newbie.
This is what my macro looks like. It's to send sms appointment reminders 1 day before the appointment. Can you help me convert {calendar_start_date} to DAY, DD/MM/YY format within the macro please?
1692273678100.png
 

Knightmare00

New member
Something is not working. This is the sms Im getting with the above macro.
Could you please fix and include DAY, DD/MM/YY ?
 

Attachments

  • Screenshot_20230817-214721.png
    Screenshot_20230817-214721.png
    20.7 KB · Views: 10

Endercraft

Moderator (& bug finder :D)
Verify that the text for input variable inside the action block action configuration screen is {calendar_start_date}.
If that still gives invalid, please provide an example date (given by {calendar_start_date}) because the date should match just fine.
 

Knightmare00

New member
No luck, either with [calendar_start_date] or {calendar_start_date} in the action config screen. Still getting invalid.
Tomorrow's date as given by {calendar_start_date} is 17/8/23 (no 0 before the 8), if that makes sense.
 

sampleuserhere

Active member
I would like to recommend CalendarTask plugin but for some reason I couldn't pass the variable into the plugin.

If you can pass the variable into CalendarTask, you can use Format Date.

You have to format the original date (M/d/yy) into seconds, then format those seconds to new format (EEEE, dd/MM/yy)

EEEE stands for full name for the day. https://developer.android.com/reference/java/time/format/DateTimeFormatter.

Anyway, if you want to settle with Text Manipulation, you can use Replace All and do it like this.

Screenshot_2023-08-18-11-33-32-055_com.arlosoft.macrodroid.png

0* before \d+ will ensure that it eats the leading zero and exclude it from the match group ($#).

Use the output variable in the SMS action.
 
Top