Expand my Community achievements bar.

Who had the bright idea to zero index the date time in app measurement?

Avatar

Level 1

So I guess that i can live with someone making the decision to format the date time as European time.

But I am just wanting to know who had the ingenious idea to zero index the months so that January is month 0 and December is month 11....

Not sure if someone was trying to be funny or pretentious.

Example

Debugging code today  December 7, 2018 at 17:21 and here is what I see in the time field.

SS 2018-12-07 at 17.34.26.jpg

Just wanting to chat with the genius that thought this would be the best idea.

4 Replies

Avatar

Community Advisor

This is simply never used and not processed. It is send that is all.

In terms of timestamp:

  • Documentation:
  • This is how it works:
    • If you are using s.timestamp then you will see a new query param ts .
      • If report suite is timestamp disabled then any hit that contain ts= will be filtered out
      • If report suite is timestamp enabled then only hits with ts= will be processed, any hits missing ts will be filtered out
      • If report suite if timestamp optional then if ts is not available then a timestamp will be generated when the hit isd received server side
    • By default if report suite is configured correctly (timestamp disabled or timestamp optional) then when the server call is received by adobe servers then a timestamp is generated at that time.
      • Actually a server side timestamp is always generated but will not be used see below for data feed
    • In data feed you have 2 columns:
      • hit_time_gmt: the timestamp generated server side and will be used
        • If RS is timestamp is disabled
        • If RS is timestamp is optional AND cust_hit_time_gmt is not set
      • cust_hit_time_gmt: timestamp provided in ts query parameter and will be used
        • if RS is timestamp enabled
        • if RS is timestamp optional AND cust_hit_time_gmt present

Avatar

Employee Advisor

I totally feel you. Granted, this was implemented well over a decade ago. I'm pretty sure it even predates G code...

Thankfully it's automatically collected and not surfaced anywhere important. The Experience Cloud Debugger extension doesn't show it anywhere in an image request since it's just one of those things that just works behind the scenes.

But still - I do share a similar opinion. When I first found out about image request query string dates being 0 for January, I could not figure out for the life of me why they did that.

Avatar

Community Advisor

I believe it is just a result of coding standards at the time. I think the code related to query param t= is as follow

As you can see they using date and I found a related topic here:

datetime - Why does the month argument range from 0 to 11 in JavaScript's Date constructor? - Stack ...

Avatar

Employee Advisor

Wow, thanks Alexis! In that thread, it looks like the JS's date was directly ported from Java 1.0, which led to this question: Why is January month 0 in Java Calendar? - Stack Overflow

The first answers mentions that's it's simply a mess, but the second answer provides some pretty solid logic in that it's a lot easier to calculate month differences using the % operator.

In other words, the blame can't solely be pinned on Adobe - you've also got the people who decided to port the Java 1.0 calendar utility to JavaScript, and the people who decided to implement the Java calendar in the first place. This all happened in the mid-90's to boot.