Skip to content
Comparing Datetime ...
 
Notifications
Clear all

Comparing Datetime Values

5 Posts
3 Users
0 Reactions
4 Views
Lyubomir_Kazasov
(@lyubomir_kazasov)
Posts: 3
Active Member
Topic starter
 

Hello everybody,

what’s the best approach to compare two date fields (not using a filter)?

I have two timestamps from two different Mailchimp Audiences:

A: 2024-01-24T08:24:33.000Z
B: 2024-01-24T08:26:23.000Z

I need to figure out if A or B occurred earlier. Both A and B are date types.

Which comparison operator should I use?

 
Posted : 24/01/2024 8:44 am
Lyubomir_Kazasov
(@lyubomir_kazasov)
Posts: 3
Active Member
Topic starter
 

Hi, thanks for the response, but I'm unable to find a toTimestamp() function.

I need to calculate this value and save it into a merge field. The image below illustrates what I'm trying to achieve (though it's not currently working). Both 1.timestamp_opt and 3.timestamp_opt are of the date type.

Could you please advise on how to proceed?

 
Posted : 24/01/2024 9:25 am
ThakurHemansh
(@thakurhemansh)
Posts: 1
New Member
 

Okay, I could have also suggested using format date, but the solution was simpler this way.

 
Posted : 24/01/2024 10:34 am
Lyubomir_Kazasov
(@lyubomir_kazasov)
Posts: 3
Active Member
Topic starter
 

I’ve finally managed to achieve this like this:


{{ if(parseNumber( formatDate(A; "x"); ",") > parseNumber(formatDate(B; "x"); ","); "regis_last"; "subs_last")}}

where A and B are datetime vars

 
Posted : 24/01/2024 11:50 am
samliew
(@samliew)
Posts: 293
Reputable Member
 

Could you clarify the location of this toTimestamp function? I suspect the use of AI, as it can sometimes generate information that doesn't exist (often referred to as hallucinations).

Using AI tools like ChatGPT to answer questions on this forum is not permitted. AI lacks knowledge of callin.io's capabilities, functions, apps, and modules. Please refrain from using AI to generate responses for this forum.

 
Posted : 24/01/2024 11:52 am
Share: