Все вопросы: [timestamp]

180 вопросов

12
голосов
2ответов
11933 просмотров

How can I get an accurate UTC time with Python?

I wrote a desktop application and was using datetime.datetime.utcnow() for timestamping, however I've recently noticed that some people using the application get wildly different results than I do when we run the program at the same time. Is there any way to get the UTC time locally without usin...

1
голосов
2ответов
569 просмотров

php timestamp problem

i have a "simple" problem with the PHP timestamp (on a linux machine). I need to get the user birthdate in year-month-date (using 3 menus - html select). When the user is born on 1970-1-1 the timestamp is zero and the application logic gets everything wrong. How would you deal with this case? ...

0
голосов
3ответов
205 просмотров

PHP timestamp time function: 2008 is larger than 2009?

I don't get it. I want to check if the time out of the database is before or after the current time, so I wrote this: $qVraagCodeOp = "SELECT * FROM `code` WHERE `Code_Code` = '$value'"; $rVraagCodeOp = mysql_query($qVraagCodeOp); $aVraagCodeOp = mysql_fetch_assoc($rVraagCodeOp); $oldTime = mk...

0
голосов
2ответов
4563 просмотров

Can HQL substract or sum date fields?

A have two entities. For example timing settings and orders. @Entity public class TimingSettings{ @Basic private Long orderTimeout = 18000; //for example 18000 sec .... } @Entity public class Order{ @Basic @OneToOne private TimingSettings timingSettings; @Tempor...

1
голосов
3ответов
2015 просмотров

converting strptime into 'X hours ago'

I have a a date in strptime that I want to show as 'X hours ago'. I can happily convert hours into days and weeks etc. but I don't know how to do the initial sum. Here is how I'm converting the string into strptime: time.strptime(obj.created_at, '%a %b %d %H:%M:%S +0000 %Y') p.s. bonus points ...

1
голосов
1ответов
433 просмотров

subsonic timestamp issue on insert record

My problem is about the timestamp column in one of my database tables. This field is required because sqlserver automatically generates it. Since this column is required subsonic included it in the insert query.. im using subsonic 3.0 info.Save(); error message: Cannot insert an explicit v...

8
голосов
4ответов
2826 просмотров

How does MySQL store timestamps internally?

How does MySQL store timestamps internally? Is it an int, or a string or something else?

1
голосов
2ответов
4305 просмотров

Cannot set current _timestamp or now() with PDO on MySQL

I use PDO prepared statements in a Web application I'm building. I have a timestamp column set to current_timestamp as default value. Using a timestamp should normally assign the current timestamp when the column value is null, same as now() would do. But no matter what I try, I get a NULL value...

2
голосов
5ответов
4822 просмотров

How can I use Perl to do datetime comparisons and calculate deltas?

I extracted year, month, day, hour, minute, second, and millisecond data from human readable text (it wasn't in a timestamp format, but rather something like "X started at HH:MM:SS.SSS on DD MMM YYYY and ended at HH:MM:SS.SSSS on DD MMM YYYY"), so for each recorded event, I have each of the value...

0
голосов
1ответов
1189 просмотров

how to send a http post request to server in iphone app?

how do i send device token from my native iphone app with a specific timer request so that after the specified time push notification alert comes to device.

3
голосов
5ответов
20370 просмотров

Get timezone offset in PHP given a unix timestamp

I have a Unix timestamp that comes from a database that is (unfortunately) in a timezone with a certain of either +3600 or +7200, depending on if it's DST or not. This has never been a problem before, but our website is currently moving to a more international audience and because of Javascript i...

2
голосов
3ответов
4107 просмотров

How do I simply retrieve timestamp of recording from DV (as in DV tape) AVI files?

I am looking for a way to retrieve or extract the timestamp of the recording from DV AVI files. The timestamp should be part of the AVI file's metadata. The files were originally imported from DV to PC and a DV format in an AVI wrapper. A library providing an API - or a command-line tool would b...

2
голосов
1ответов
1755 просмотров

PHP: strtotime() gives me wrong timestamp

This is my code: $testtime = str_replace('.', '-', '2009.07.08 17:01'); $timestamp = strtotime($testtime); echo $timestamp . "\n"; echo $testtime . "\n"; echo date('Y-m-d H:t', $timestamp); And this is my output: 1247065260 2009-07-08 17:01 2009-07-08 17:31 What's wrong? Thank...

3
голосов
3ответов
2358 просмотров

Calculating a month as a "between" period in java

I want to select records that have a created date between the first and the last day of a given month. I calculate the month with begin and enddate the following way: The Date "month" is just a random date inside the timeframe Calendar cal = Calendar.getInstance(); cal.setTime(month); int endda...

3
голосов
5ответов
816 просмотров

How to get a timestamp older than 1901

I'm trying to find to accurately count the number of seconds since Jan 1, 1850 to the present in a couple of languages (JavaScript, C++, and Python [don't even ask, I stopped asking these questions long ago]). Problem is the platforms store timestamps as 32-bit signed integers, so I can't get a ...

20
голосов
5ответов
31964 просмотров

Output several timestamps in ant

The Ant buildfile snippet below is an attempt to simply output the time before and after each sql script is run. I cannot change the structure of the Ant targets (create-tables must call run-sql-script just as it does). The problem is that the properties (time and time2) are immutable (http://a...

1
голосов
2ответов
3729 просмотров

How to convert a GMT timestamp to Unix timestamp (javascript)

I'm parsing an rss feed and each entry has a timestamp such as this: 2009-09-21T21:24:43+04:00 Is there any way to convert this date format to a unix timestamp with javascript? I just want to be able to record the latest rss entry date, but I need to standardize the time to GMT time or Unix time...

0
голосов
2ответов
739 просмотров

PHP swap month and day in timestamp

Right. I was inserting a load of data into a MySQL DB and used the following to generate the timestamp: $stamp = mktime($t[0], $t[1], $t[2], $d[2], $d[1], $d[0]); Unfortunately, the day and month were mixed around, and below is the correct timestamp. $stamp = mktime($t[0], $t[1], $t[2], $d[1]...

0
голосов
2ответов
1037 просмотров

Validating Timestamp overlaps with PHP

My database holds date, start and end variables. In my code I grab the start and them as the user selects them, and convert them to timestamps like so (all inside a foreach loop).. $selectionDate = strtotime($timeQry['date']); $startTimes[] = strtotime($timeQry['start'],$selectionDate);...

23
голосов
9ответов
139504 просмотров

Time stamp in the C programming language

How do I stamp two times t1 and t2 and get the difference in milliseconds in C?

1
голосов
3ответов
2778 просмотров

Consuming Java Webservice TimeStamp from .net and WCF

We are trying to talk to a (possible)Java WebService from .NET 3.5 using WCF. The WebService defines a Timestamp object which seems to be a datetime without the decimal milliseconds. WCF decided .NET would use a datatime as the object backing in the proxy class. When sending objects with the t...

1
голосов
1ответов
2621 просмотров

Timestamp updating in table with REPLACE INTO

I have a plus/minus system where a user can add one or minus one away from a blog post. My database (MySQL) table looks like this: userid entry id vote - which is +1 or -1 timeStamp I have set the timeStamp to default to CURRENT_TIMESTAMP. I have to methods plus() and minus(). Both do the sam...

0
голосов
2ответов
2426 просмотров

How to Declare timestamp as variable and convert to ddmmyy format

I have a date issue here. I have a timestamp field in mysql table called filedate. However I have tried several times to declare it and also convert it to a dd-mm-yy format. Unfortunately when I load it the date is still in timestamp format and when I then upload it claims I haven't declared the ...

9
голосов
1ответов
3328 просмотров

Is SQL Server Timestamp deprecated and what to use in replacement

The T-SQL MSDN page states The timestamp syntax is deprecated. This feature will be removed in a future version of Microsoft SQL Server. Avoid using this feature in new development work, and plan to modify applications that currently use this feature. Does this mean to suggest t...

238
голосов
30ответов
250233 просмотров

Converting timestamp to time ago in PHP e.g 1 day ago, 2 days ago...

I am trying to convert a timestamp of the format 2009-09-12 20:57:19 and turn it into something like 3 minutes ago with PHP. I found a useful script to do this, but I think it's looking for a different format to be used as the time variable. The script I'm wanting to modify to work with this for...

62
голосов
10ответов
52952 просмотров

How to get timestamp of tick precision in .NET / C#?

Up until now I used DateTime.Now for getting timestamps, but I noticed that if you print DateTime.Now in a loop you will see that it increments in descrete jumps of approx. 15 ms. But for certain scenarios in my application I need to get the most accurate timestamp possible, preferably with tick ...

0
голосов
2ответов
709 просмотров

PHP - Upload 6 Images (MAX 1mb per file)

I was wondering what the best way to send 6 'file' inputs to a php page would be... and how to process them, i used this website to understand uploading one file PHP Tutorial - File Uplaod Also, i want to name each of the 6 images with a time stamp for example below... 00000000 00000001 000000...

1
голосов
2ответов
159 просмотров

Subsonic 3.0 with timestamp field in SQL 2005

I have a timestamp field in a table and when i create a new instance of my object, set some fields, do not set the timestamp field and use the .Save(), i get an error saying that i cannot set an exlicite value to a timestamp field during an INSERT. How can i have SubSonic not save anything in th...

2
голосов
4ответов
5888 просмотров

How to change the format of timestamp in CakePHP?

In my application,I retrieve a timestamp from the table which is of the format 2009-08-18 12:09:01. I need to change this to August 18th,2009 or 18 Aug,2009. How to achieve this in CakePHP? Are there any built in methods?

1
голосов
2ответов
1490 просмотров

extract date from datetime stamp

Anyone know how to extract the date from a datetime stamp as part of the where clause? eg. select * from tableA where date between '01/08/2009' and '31/08/2009' (Date is a timestamp!) Many thanks, Fiona