unix-timestamp

Android SensorEvent timestamp issue

∥☆過路亽.° 提交于 2020-01-01 07:04:23
问题 I am currently working on an android application where I have to log all the sensor values. I got the sensor event timestamp from "event.timestamp" and I converted this value into a unix timestamp. long currTimeRelativeToBootMs = SystemClock.uptimeMillis(); long currTimeAbsoluteMs = System.currentTimeMillis(); mStartTimeAbsoluteS = ((double)(currTimeAbsoluteMs - currTimeRelativeToBootMs))/(double)1000.0; ... //timestampRelativeInNs = event.timestamp double temp = mStartTimeAbsoluteS+((double

Android SensorEvent timestamp issue

一世执手 提交于 2020-01-01 07:03:07
问题 I am currently working on an android application where I have to log all the sensor values. I got the sensor event timestamp from "event.timestamp" and I converted this value into a unix timestamp. long currTimeRelativeToBootMs = SystemClock.uptimeMillis(); long currTimeAbsoluteMs = System.currentTimeMillis(); mStartTimeAbsoluteS = ((double)(currTimeAbsoluteMs - currTimeRelativeToBootMs))/(double)1000.0; ... //timestampRelativeInNs = event.timestamp double temp = mStartTimeAbsoluteS+((double

How to handle MySQL timezone in script

不问归期 提交于 2019-12-31 03:45:29
问题 I am developing a mobile application. From the application calls are made to a web service which runs different queries based on mode (?mode=xx) In some of those queries I use date functions like DATE(NOW()). The data stored in the MySQL database is stored in GMT-7 (Mountain Time Canada). I have yet to register a domain/host for this web service but when I do lets say it is hosted in a different city such as Toronto (which is GMT-5 - 2 hours ahead). Then at 10:05pm Mountain Time Canada a user

Converting unix time into date-time via excel

依然范特西╮ 提交于 2019-12-29 19:26:29
问题 Trying to convert 1504865618099.00 Unix time into a readable date time. I tried this: =(UNIX + ("1/1/1970"-"1/1/1900"+1)*86400) / 86400 But it's not working. 回答1: To convert the epoch(Unix-Time) to regular time like for the below timestamp Ex: 1517577336206 First convert the value with the following function like below =LEFT(A1,10) & "." & RIGHT(A1,3) The output will be like below Ex: 1517577336.206 Now Add the formula like below =(((B1/60)/60)/24)+DATE(1970,1,1) Now format the cell like

Getting unix timestamp in seconds out of MongoDB ISODate during aggregation

给你一囗甜甜゛ 提交于 2019-12-29 05:34:09
问题 I was searching for this one but I couldn't find anything useful to solve my case. What I want is to get the unix timestamp in seconds out of MongoDB ISODate during aggregation. The problem is that I can get the timestamp out of ISODate but it's in milliseconds. So I would need to cut out those milliseconds. What I've tried is: > db.data.aggregate([ {$match: {dt:2}}, {$project: {timestamp: {$concat: [{$substr: ["$md", 0, -1]}, '01', {$substr: ["$id", 0, -1]}]}}} ]) As you can see I'm trying

R how to convert timestamps into multiple timezones in the same column

瘦欲@ 提交于 2019-12-25 08:15:40
问题 I have a dataframe that contains two character variables: one is a timestamp and the other is a US state. I have been unsuccessfully trying to convert each timestamp to a POSIX object, with time zone assigned according to the corresponding value for state: Eastern Time (EST) for Florida (FL) and Central Time (CST6CDT) for Texas (TX). However, no matter what I try, R will only return either all of the time stamps in a single time zone or else as a string containing the number of seconds since

Hive - UNIX_TIMESTAMP Quandary

。_饼干妹妹 提交于 2019-12-25 03:32:59
问题 Here is my 1 line of data (for brevity): 73831 12/26/2014 1:00:00 AM 0.3220 The 2nd column is the time column which is in string format. I'm using this hive query: select col2, UNIX_TIMESTAMP(col2,'MM/DD/YYYY hh:mm:ss aaa') from Table Here is what I get: 1388296800 However, when I check with, http://www.epochconverter.com/ and also from_unixtime(1388296800) , I get a different date. Is there something wrong with my format / pattern string I enter into UNIX_TIMESTAMP in Hive? 回答1: Your date

Can I get Unix timestamp automatically converted to a DATETIME column when importing from CSV to a (My)SQL database?

丶灬走出姿态 提交于 2019-12-24 15:25:24
问题 I created a table that has a timestamp DATETIME column and I am trying to import data from CSV files that have Unix timestamped rows. However, when I try to use DataGrip's CSV import feature, I get errors to the tune of 1:1: conversion failed: "1394669640" to datetime 2:1: conversion failed: "1394670060" to datetime 3:1: conversion failed: "1394670480" to datetime 4:1: conversion failed: "1394670780" to datetime Maybe dataGrip is not the best tool, but that's pretty much all I can do with,

NSDate, timezones and Unix timestamp confusion

和自甴很熟 提交于 2019-12-24 14:21:07
问题 I took over the project of some programmers who unfortunately left a lot of stuff unclear in the code. Basically we have stored some flight events in our database with a departure and arrival time. It the database (as far as we can tell) everything is stored in UTC (as it should) and in the iOS app they use some Realm objects as database model. I basically want to look for all flights in a 24 hour period, corresponding to the 24 hour day of the user's device. - (NSDate *

How to show a Unix-time in a local time format

丶灬走出姿态 提交于 2019-12-24 10:56:36
问题 I have a php variable say $expTime (which has a unixtime say-1359683953) . I want to display this variable on the client side(in a proper time format according to his local time) . I am so confused between the UTC ,GMT , DST all that things. Can anyone suggest a solution for this using php or javascript please. when I am using echo date('h:i M d/y',$expTime) it is showing me a wrong time. How I am saving the time to database: var exp_day= parseInt($("#exp_day").val()); var exp_hrs= parseInt($