[SOLVED] Very strange date comparison in Auto Action

6 years 7 months ago #297459 by fribse2011
Replied by fribse2011 on topic Very strange date comparison in Auto Action
Ok, so I did this:
[cb:parse function="time"][cb:date format="Y-m-d" /][/cb:parse] GREATER THAN OR EQUAL TO [cb:parse function="time"][cb:date format="Y" /]-11-30[/cb:parse]

That seems to show something reasonable, allthough it's quite hard to interpret the numbers, but do I need to enter the offset here?

Best regards
Fribse

Frømandsklubben Nikon, www.nikondyk.dk
We're a volunteer driven diving club in Ishøj, Denmark.
Har du brug for en dykkerklub der rummer alle, så kom ned til os.

Please Log in to join the conversation.

6 years 7 months ago #297461 by krileon
Replied by krileon on topic Very strange date comparison in Auto Action

That seems to show something reasonable, allthough it's quite hard to interpret the numbers, but do I need to enter the offset here?

If you use [cb:date format="Y-m-d" /] it will be offset by the server timezone. You can not turn this off. The format is the end result. Even if you exclude it offset is applied to 00:00:00. You have to use format functions for more control. You should be able to use [cb:parse function="time"]now[/cb:parse] to get the current timestamp without offset applied.


Kyle (Krileon)
Community Builder Team Member
Before posting on forums: Read FAQ thoroughly + Read our Documentation + Search the forums
CB links: Documentation - Localization - CB Quickstart - CB Paid Subscriptions - Add-Ons - Forge
--
If you are a Professional, Developer, or CB Paid Subscriptions subscriber and have a support issue please always post in your respective support forums for best results!
--
If I've missed your support post with a delay of 3 days or greater and are a Professional, Developer, or CBSubs subscriber please send me a private message with your thread and will reply when possible!
--
Please note I am available Monday - Friday from 8:00 AM CST to 4:00 PM CST. I am away on weekends (Saturday and Sunday) and if I've missed your post on or before a weekend after business hours please wait for the next following business day (Monday) and will get to your issue as soon as possible, thank you.
--
My role here is to provide guidance and assistance. I cannot provide custom code for each custom requirement. Please do not inquire me about custom development.

Please Log in to join the conversation.

6 years 7 months ago #297479 by fribse2011
Replied by fribse2011 on topic Very strange date comparison in Auto Action
I tried changing it to
[cb:parse function="time"]now[cb:date format="Y-m-d" /][/cb:parse] GREATER THAN OR EQUAL TO [cb:parse function="time"]now[cb:date format="Y" /]-11-30[/cb:parse]
But I don't see any difference with or without the 'now' in there?

Best regards
Fribse

Frømandsklubben Nikon, www.nikondyk.dk
We're a volunteer driven diving club in Ishøj, Denmark.
Har du brug for en dykkerklub der rummer alle, så kom ned til os.

Please Log in to join the conversation.

6 years 7 months ago - 6 years 7 months ago #297480 by fribse2011
Replied by fribse2011 on topic Very strange date comparison in Auto Action
I found another comparison I need to look at, I got this from you guys last year, it is supposed to tell me id a member is 12 years old or more:

[cb:parse function="date" date-format="Y" time="false"][cb:parse function="time" time="+12 YEARS"][cb_birthday][/cb:parse][/cb:parse] LESS THAN OR EQUAL TO [cb:parse function="date" date-format="Y" time="false"][/cb:parse]

Should I just enter now in the latter:

[cb:parse function="date" date-format="Y" time="false"][cb:parse function="time" time="+12 YEARS"][cb_birthday][/cb:parse][/cb:parse] LESS THAN OR EQUAL TO [cb:parse function="date" date-format="Y" time="false"]now[/cb:parse]

Best regards
Fribse

Frømandsklubben Nikon, www.nikondyk.dk
We're a volunteer driven diving club in Ishøj, Denmark.
Har du brug for en dykkerklub der rummer alle, så kom ned til os.

Please Log in to join the conversation.

6 years 7 months ago #297498 by krileon
Replied by krileon on topic Very strange date comparison in Auto Action
To get the current datetime timestamp you'd use [cb:parse function="time"]now[/cb:parse].

But I don't see any difference with or without the 'now' in there?

Don't just add "now" with the existing usage. If you need the current datetime timestamp only specify "now". The below is probably fine.

[cb:parse function="time"]now[/cb:parse] GREATER THAN OR EQUAL TO [cb:parse function="time"][cb:date format="Y" /]-11-30[/cb:parse]


Kyle (Krileon)
Community Builder Team Member
Before posting on forums: Read FAQ thoroughly + Read our Documentation + Search the forums
CB links: Documentation - Localization - CB Quickstart - CB Paid Subscriptions - Add-Ons - Forge
--
If you are a Professional, Developer, or CB Paid Subscriptions subscriber and have a support issue please always post in your respective support forums for best results!
--
If I've missed your support post with a delay of 3 days or greater and are a Professional, Developer, or CBSubs subscriber please send me a private message with your thread and will reply when possible!
--
Please note I am available Monday - Friday from 8:00 AM CST to 4:00 PM CST. I am away on weekends (Saturday and Sunday) and if I've missed your post on or before a weekend after business hours please wait for the next following business day (Monday) and will get to your issue as soon as possible, thank you.
--
My role here is to provide guidance and assistance. I cannot provide custom code for each custom requirement. Please do not inquire me about custom development.

Please Log in to join the conversation.

6 years 7 months ago - 6 years 7 months ago #297522 by fribse2011
Replied by fribse2011 on topic Very strange date comparison in Auto Action
Ok, that looks ok. Allthough both of them are delivered in UTC, I found an epoch converter that could show the right date. But as they are both in UTC, the difference is the same on both sides.
But that got me thinking about the other comparisons.
Becauce I'm in UTC+2 I need to trigger all the datecomparisons AFTER 02.00 at night?

Best regards
Fribse

Frømandsklubben Nikon, www.nikondyk.dk
We're a volunteer driven diving club in Ishøj, Denmark.
Har du brug for en dykkerklub der rummer alle, så kom ned til os.

Please Log in to join the conversation.

Moderators: beatnantkrileon
Time to create page: 0.200 seconds

Facebook Twitter LinkedIn