Highcharts DateTime not parsing correctly - highcharts

I'm using UTC epoch strings, but they are not imported correctly. None of the other datetime issues I've looked at on stackOverflow are helping. See this screenshot: https://www.screencast.com/t/Y7NWA09BKHY
And man, is this chart ugly :/ Any style hints for a bootstrap layout would be appreciated...

Use milliseconds, not seconds, from 1/1/1970 00:00:00 UTC.

Related

ISOWEEKNUM and WEEKNUM function giving back wrong value

I'm trying to convert a date into a week number, which should be simple, only it's giving back value. Instead of the week number, it says 16/01/1900 00:00:00.
I used =ISOWEEKNUM(C2) and =WEEKNUM(C2, 2) and I tried it without time and in different date formats as well.
Does somebody know how to fix this issue?
Issue is found, the cells of the week numbers had a date format, so I had to convert it into plain text. It works now!

How can I programmatically change an RFC3339 timezone offset in Ruby?

I'm wondering how I can programmatically change an RFC3339 DateTime's timezone offset in Ruby 2.3 (ActiveSupport is available, if that'd help).
I'd like to convert: 2016-06-22T00:00:00+00:00 into 2016-06-22T00:00:00-04:00 without resorting to string substitution.
EDIT: Per the Tin Man's request, I'll elaborate on what I've tried. As alluded to above, I tried using String#sub to find-and-replace the offending section of the original string. That worked, but I considered it to be a kludge and wanted to find a solution that made use of the Time/Date API.
Have a look at DateTime#change, you can pass in an offset.
require 'active_support/core_ext/date_time'
DateTime.now.change(offset: '-0400')
#=> Wed, 22 Jun 2016 23:47:34 -0400

iOS date format with microseconds strange behavior

I have a strange problem with parsing date string. I have a date formatter with format:
yyyy-MM-dd HH:mm:ss.SSSSSSZZ
and date string:
2012-11-09 10:47:01.999804+01
dateFromString method returns nil, but when I change date string to ie:
2012-11-09 10:47:01.989804+01
it works... Does anyone has idea why there is such limit for microseconds value and how can I properly parse dates like the one above?
I could parse that with regex and cut whole SSSSSS part, but generally sometimes I will need to compare dates so they would not be matching and it will cause more problems.
I had no end of niggly issues doing this, finally got it to work but stripped the point seconds off and used the format as follows
#define DATEFORMATSTRINGTIMEZONE #"yyyy-MM-dd HH:mm ZZZ"
a bit like you say. I have to admit a bit more into the project I realized this was a very difficult method of sharing dates and instead adopted epoch time which has saved all headaches I was having regarding timezones... I'd highly recommend it if you have the luxury of changing the incoming data format.
Whilst I'm not sure why yours doesn't parse, I would question the ZZ instead of the ZZZ at the end given you have +01 not +1?
I have finally resolved that issue.
I'm modifying date format and date string to remove microseconds so I can parse date properly. Then I just add microseconds parsed from original date string.

Getting previous day's date in Lua

Can anyone kindly enlighten me on how to get previous day's date in 'YYYY-MM-DD' format using Lua?
I.E., a snippet that will return the date of the previous day from the day during which it is run.
Try
print(os.date("%Y-%m-%d",os.time()-24*60*60))
Strictly speaking this is only guaranteed to work on a POSIX system, but it probably works in most systems.
There is a library LuaDate which can be very helpful for Date Manipulations
http://luaforge.net/projects/date/
It is very easy to use, since it is documented well!

What date format is this?

I have a web service returning JSON data with some date fields but I couldn't recognize the date format to parse this date field.
2010-11-05TNov:10:1288995006 UTC
2010-10-28TOct:37:1288301863 UTC
2010-10-05TOct:33:1286314434 UTC
That is a quite weird timestamp, isn't it.
yyyy[-]mm[-]dd"T"hh":"mm":"ss.nnnnnn"Z" is an ISO standard date format (ISO 8601), which is similar to what appears in the first field of that... but it has what appear to be three field groups, holding what appear to be:
yyyy-mm-dd"T"MMM:??:POSIX-TIMESTAMP UTC
The current time being 1292563122, those would appear to have been generated 3,568,116 seconds (or approximately 41 days) ago.
Hope this helps.
The first epoch (1288995006) translates to
Fri, 05 Nov 2010 22:10:06 GMT
Seems, somebody obfuscated or messed up the human readable month part - 22 would make more
sense than Nov. If you care about the date, I'd suggest you go with the epoch.
Sidenote:
If a date and a time are displayed on the same line, then always write the date in front of the time. If a date and a time value are stored together in a single data field, then ISO 8601 suggests that they should be separated by a latin capital letter T, as in 19951231T235959.
http://www.cl.cam.ac.uk/~mgk25/iso-time.html
I think you are asking the wrong people. You should really be asking whoever is responsible for creating the web service where there documentation is and / or what format the timestamps are supposed to be.
(FWIW - I agree with the consensus that the timestamp format is probably erroneous.)

Resources