question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Feel free to throw me back over to GeoNet.

I have an epoch beind updated on my Hosted Feature Service.

APIdate (type: esriFieldTypeInteger, alias: API date (epoch), SQL Type: sqlTypeOther...

If I apply a simple expression:

Date($feature.APIdate)

It returns the wrong year entirely.

image

However, if I check this epoch in an online tool, it converts correctly:

image

Im sure this is an easy one - what am I missing in my expression?

What I really want to achieve, is how many minutes since last update.

Something like this? DateDiff((Date($feature.APIdate)), Now(), minutes)

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:5

github_iconTop GitHub Comments

1reaction
ekenescommented, Nov 13, 2018

DateDiff(Now(), Date($feature.APIdate * 1000), minutes) returns an error because the value of the third parameter must be a string. You’re passing minutes instead of 'minutes', so it treats minutes like an undeclared variable.

Try the following and it should work: DateDiff(Now(), Date($feature.APIdate * 1000), 'minutes')

1reaction
ekenescommented, Nov 9, 2018

This looks like a difference between the meaning of “epoch” in UNIX versus JavaScript. What you’re looking for is:

Date($feature.APIdate * 1000)

I tested with your example and it appears to work. You’ll notice the behavior is the same in JavaScript as it is in Arcade.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Issue Date Definition: Everything You Need to Know
Issue date definition is the day on which a company issues an agreement or contract, such as an insurance policy.
Read more >
Date of Issue: Definition and Examples (2022)
A date of issue, also known as the issuance date, is when a bond is issued to a startup. It's also used when...
Read more >
Date of issue Definition - Nasdaq
Date of issue. Used in the context of bonds to refer to the date on which a bond is issued and when interest...
Read more >
Date of Issue Definition: 453 Samples | Law Insider
Date of Issue means the date on which the notice of a decision of the Development Authority is published, or five (5) working...
Read more >
Issue date - Wikipedia
Issue date ; Cover date, the date displayed on the covers of periodical publications ; Effective date, the date upon which something is...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found