[SOLVED] Very strange date comparison in Auto Action

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

Becauce I'm in UTC+2 I need to trigger all the datecomparisons AFTER 02.00 at night?

No, it doesn't matter what your offset is. The calculations will always be UTC using the above configuration.


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 #297560 by fribse2011
Replied by fribse2011 on topic Very strange date comparison in Auto Action
I'm a bit confused.
Are you saying that with the above, it will use the defined time as if it was UTC, no matter if the time is not UTC, as long as I add the offset="UTC"?

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 #297573 by krileon
Replied by krileon on topic Very strange date comparison in Auto Action
Yes, [cb:parse function="time"]now[/cb:parse] will be UTC. It's using strtotime. If the PHP default offset has been changed it won't be UTC, but that rarely should happen and will also be addressed in a later release to use our date API instead of strtotime directly. You should be fine using the below.

[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 6 months ago - 6 years 6 months ago #297875 by fribse2011
Replied by fribse2011 on topic Very strange date comparison in Auto Action
I still can't seem to get this working.

I've run this comparison (today), user 368 has set a birthday of 05-10-1986 (shows in the DB as 1985-10-05

[cb:parse function="date" date-format="m-d" time="false"][cb_birthday][/cb:parse] EQUAL TO [cb:parse function="date" date-format="m-d" time="false"]now[/cb:parse]

First day is from the DB and second date is from the server.

That gives the result:
:: Action 164 :: Condition 2 failed for 368: 10-04 Equal to 10-05


WHAT? so the date parse interprets the date stored in the DB 1 day off?????

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 6 months ago #297894 by krileon
Replied by krileon on topic Very strange date comparison in Auto Action
It sounds like it's stored in the database offset from local to UTC. Is it stored in the _comprofiler database table as 1986-10-05? What is the timezone set to in Joomla global configuration?


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 6 months ago - 6 years 6 months ago #297902 by fribse2011
Replied by fribse2011 on topic Very strange date comparison in Auto Action
It's stored like 1986-10-05 in the db.
Timezone is copenhagen, (utc+2)

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.
Attachments:

Please Log in to join the conversation.

Moderators: beatnantkrileon
Time to create page: 0.204 seconds

Facebook Twitter LinkedIn