Search Results

Search found 1503 results on 61 pages for 'timestamp'.

Page 7/61 | < Previous Page | 3 4 5 6 7 8 9 10 11 12 13 14  | Next Page >

  • jQuery timer, ajax, and "nice time"

    - by Mil
    So for this is what I've got: $(document).ready(function () { $("#div p").load("/update/temp.php"); function addOne() { var number = parseInt($("#div p").html()); return number + 1; } setInterval(function () { $("#div p").text(addOne()); }, 1000); setInterval(function () { $("#geupdate p").load("/update/temp.php");} ,10000); }); So this grabs a a UNIX timestamp from temp.php and puts into into #div p, and then adds 1 to it every second, and then every 10 seconds it will check the original file to keep it up to speed. My problem is that I need to format this UNIX timestamp into a format such as "1 day 3 hours 56 minutes and 3 seconds ago", while also doing all the incrementation and ajax calls. I'm not very experienced with jquery/javascript, so I might be missing something basic.

    Read the article

  • What PHP function(s) can I use to perform operations on non-integer timestamps?

    - by stephenhay
    Disclaimer, I'm not a PHP programmer, so you might find this question trivial. That's why I'm asking you! I've got this kind of timestamp: 2010-05-10T22:00:00 (That's Y-m-d) I would like to subtract, say, 10 days (or months, whatever) from this, and have my result be in the same format, i.e. 2010-04-30T22:00:00. What function(s) do I need to do this in PHP? Note: I'm using this to do a computed field in Drupal. The result will be the date that an e-mail is sent. Bonus question: If 2010-05-10T22:00:00 means "May 10, 2010 at 10pm", is there a timestamp equivalent of "May 10, 2010 (all day)"? Thanks everyone.

    Read the article

  • How can I convert (string) timestamp to mysql datetime on Windows 32 bit PHP?

    - by user239619
    I'm attempting to call LinkedIn's API and store Network Updates. Each update has a Unix timestamp that I'm retrieving as a string variable from the REST XML response. I want to convert the string timestamp to a mysql datetime format. The date() function accepts an integer as the second argument for time to be converted. However, I'm on Windows 32 bit PHP and the integer type for this platform is limited to 2147483647. $timestamp = '1293714626675'; // sample pulled from linkedin $timestamp = (int) $timestamp; // timestamp now equals 2147483647 $mysqlDatetime = date('Y-m-d H:i:s', $timestamp); // produces incorrect time Is there a better method of creating the mysql datetime in PHP? I realize that I can convert it upon insert into MySQL however, that would require changing other dependent code.

    Read the article

  • Common way to compare timestamp in oracle, postgres and mssql

    - by Pratik
    Hi There! I am writing a sql query which involves finding if timestamp falls in particular range of days . I have written that in the postgres but it doesn't works in oracle and msssql. Is there are common way to compare the timestamp across different database. My postgres sql looks something like this ... AND creation_date < (CURRENT_TIMESTAMP - interval '5 days') AND creation_date >= (CURRENT_TIMESTAMP - interval '15 days') ... Thanks! Pratik

    Read the article

  • Filtering MySQL query result according to a interval of timestamp

    - by celalo
    Let's say I have a very large MySQL table with a timestamp field. So I want to filter out some of the results not to have too many rows because I am going to print them. Let's say the timestamps are increasing as the number of rows increase and they are like every one minute on average. (Does not necessarily to be exactly once every minute, ex: 2010-06-07 03:55:14, 2010-06-07 03:56:23, 2010-06-07 03:57:01, 2010-06-07 03:57:51, 2010-06-07 03:59:21 ...) As I mentioned earlier I want to filter out some of the records, I do not have specific rule to do that, but I was thinking to filter out the rows according to the timestamp interval. After I achieve filtering I want to have a result set which has a certain amount of minutes between timestamps on average (ex: 2010-06-07 03:20:14, 2010-06-07 03:29:23, 2010-06-07 03:38:01, 2010-06-07 03:49:51, 2010-06-07 03:59:21 ...) Last but not least, the operation should not take incredible amount of time, I need this functionality to be almost fast as a normal select operation. Do you have any suggestions?

    Read the article

  • Creating a Variable of Present Date Minus a Past Timestamp

    - by John
    Hello, In the code below, "created" is a field in a MySQL table. This field is of the type "timestamp" and the default is set to "CURRENT_TIMESTAMP" of whenever a given row is created. In the query below, I would like to create a new variable that equals the present date minus the timestamp of "created", rounded off to units of days. I would like the present date to be whenever the query is run. How could I do this? Thanks in advance, John $sqlStr = "SELECT l.loginid, l.username, l.created, ...

    Read the article

  • UIEvent timestamp

    - by skajam66
    When handling a UIButton touch, you are given a UIEvent object. The UIEvent object has a timestamp which the Apple documentation states as being "the time that the event was created" (UIEvent Class Reference). In the documentation on the Main Event Loop, it states that: "The application object obtains the topmost object in the event queue, converts it to an event object (UIEvent) ..." Does [UIEvent timestamp] refer to the time at which the UIEvent object is created (i.e. after processing the touch event off of the main run loop and hance not remotely real-time) or does it refer to the time that the underlying touch object was created (and hence as close as possible to representing the actual time of the user touch9?

    Read the article

  • Hibernate Query - Get latest versions by timestamp?

    - by Slim
    I have a database that is being used as a sort of version control system. That is, instead of ever updating any rows, I add a new row with the same information. Each row also contains a version column that is a date timestamp, so the only difference is the new row will have a more recent timestamp. What I'm having trouble with is writing an efficient hibernate query to return the latest version of these rows. For the sake of example, these are rows in a table called Product, the timestamped column is version. There are multiple versions of multiple products in the table. So there may be multiple versions (rows) of ProductA, multiple versions of ProductB, etc. And I would like to grab the latest version of each. Can I do this in just a single hibernate query? session.createQuery("select product from Product product where...?"); Or would this require some intermediate steps?

    Read the article

  • How to parse time stamps with Unicode characters in Java or Perl?

    - by ram
    I'm trying to make my code as generic as possible. I'm trying to parse install time of a product installation. I will have two files in the product, one that has time stamp I need to parse and other file tells the language of the installation. This is how I'm parsing the timestamp public class ts { public static void main (String[] args){ String installTime = "2009/11/26 \u4e0b\u5348 04:40:54"; //This timestamp I got from the first file. Those unicode charecters are some Chinese charecters...AM/PM I guess //Locale = new Locale();//don't set the language yet SimpleDateFormat df = (SimpleDateFormat)DateFormat.getDateTimeInstance(DateFormat.DEFAULT,DateFormat.DEFAULT); Date instTime = null; try { instTime = df.parse(installTime); } catch (ParseException e) { // TODO Auto-generated catch block e.printStackTrace(); } System.out.println(instTime.toString()); } } The output I get is Parsing Failed java.text.ParseException: Unparseable date: "2009/11/26 \u4e0b\u5348 04:40:54" at java.text.DateFormat.parse(Unknown Source) at ts.main(ts.java:39) Exception in thread "main" java.lang.NullPointerException at ts.main(ts.java:45) It throws exception and at the end when I print it, it shows some proper date... wrong though. I would really appreciate if you could clarify me on these doubts How to parse timestamps that have unicode characters if this is not the proper way? If parsing is failed, how could instTime able to hold some date, wrong though? I know its some chinese,Korean time stamps so I set the locale to zh and ko as follows.. even then same error comes again Locale = new Locale("ko"); Locale = new Locale("ja"); Locale = new Locale("zh"); How can I do the same thing in Perl? I can't use Date::Manip package; Is there any other way?

    Read the article

  • Why does this SELECT ... JOIN statement return no results?

    - by Stephen
    I have two tables: 1. tableA is a list of records with many columns. There is a timestamp column called "created" 2. tableB is used to track users in my application that have locked a record in tableA for review. It consists of four columns: id, user_id, record_id, and another timestamp collumn. I'm trying to select up to 10 records from tableA that have not been locked by for review by anyone in tableB (I'm also filtering in the WHERE clause by a few other columns from tableA like record status). Here's what I've come up with so far: SELECT tableA.* FROM tableA LEFT OUTER JOIN tableB ON tableA.id = tableB.record_id WHERE tableB.id = NULL AND tableA.status = 'new' AND tableA.project != 'someproject' AND tableA.created BETWEEN '1999-01-01 00:00:00' AND '2010-05-06 23:59:59' ORDER BY tableA.created ASC LIMIT 0, 10; There are currently a few thousand records in tableA and zero records in tableB. There are definitely records that fall between those timestamps, and I've verified this with a simple SELECT * FROM tableA WHERE created BETWEEN '1999-01-01 00:00:00' AND '2010-05-06 23:59:59' The first statement above returns zero rows, and the second one returns over 2,000 rows.

    Read the article

  • List full timestamps of files in a tarball

    - by Mechanical snail
    I have a large tar archive and want to see the exact (nanosecond) timestamps that are stored for each file in the archive. In case it's relevant, the tarball is in POSIX-2001 format (tar --format=posix). tar --list --verbose displays the timestamps rounded off to the minute. For comparison, ls --full-time does what I want, but I'd rather not have to extract everything first because it's huge. For my purposes, command-line and GUI tools are both fine.

    Read the article

  • grouping by date in excel and removing time in a pivot table

    - by Ashley DeVan
    My data looks like this: count Added Date 1 8/26/09 3:46 PM 2 8/21/09 6:50 PM 3 8/21/09 3:04 PM 4 8/21/09 3:21 PM 5 5/1/09 6:56 AM 6 5/1/09 8:12 AM 7 5/1/09 8:00 AM 8 5/1/09 8:18 AM 9 5/1/09 8:58 AM 10 5/1/09 8:58 AM 11 5/1/09 9:06 AM 12 5/1/09 9:44 AM 13 5/1/09 9:50 AM 14 5/1/09 11:17 AM 15 5/1/09 11:27 AM 16 5/1/09 11:29 AM 17 5/1/09 11:39 AM 18 5/1/09 12:10 PM 19 5/1/09 12:33 PM When I do a pivot table, I cannot get it to sum by day, it breaks it up by minute. I've even tried parsing the field, but the time always creates an issue. How to I get my pivot table to give me a count by day and ignore the time stamp?

    Read the article

  • How do I make rsync also check ctime?

    - by Benoît
    rsync detects files modification by comparing size and mtime. However, if for any reason, the mtime is unchanged, rsync won't detect the change, although it's possible to spot it by looking at the ctime. Of course, I can tell rsync do compare the whole files' contents, but that's very very expensive. Is there a way to make rsync smarter, for example by checking mtime+size are the same AND that ctime isn't newer than mtime (on both source and destination) ? Or should I open a feature request ? Here's an example: Create 2 files, same content and atime/mtime benoit@debian:~$ mkdir d1 && cd d1 benoit@debian:~/d1$ echo Hello > a benoit@debian:~/d1$ cp -a a b Rsync them to another (non-exisiting) directory: benoit@debian:~/d1$ cd .. benoit@debian:~$ rsync -av d1/ d2 sending incremental file list created directory d2 ./ a b sent 164 bytes received 53 bytes 434.00 bytes/sec total size is 12 speedup is 0.06 OK, everything is synced benoit@debian:~$ grep . d*/* d1/a:Hello d1/b:Hello d2/a:Hello d2/b:Hello Update file 'b', same size and then reset its atime/mtime benoit@debian:~$ echo World > d1/b benoit@debian:~$ touch -r d1/a d1/b Attempt to rsync again: benoit@debian:~$ rsync -av d1/ d2 sending incremental file list sent 63 bytes received 12 bytes 150.00 bytes/sec total size is 12 speedup is 0.16 Nope, rsync missed the change. benoit@debian:~$ grep . d*/* d1/a:Hello d1/b:World d2/a:Hello d2/b:Hello Tell rsync the compare the file content benoit@debian:~$ rsync -acv d1/ d2 sending incremental file list b sent 144 bytes received 31 bytes 350.00 bytes/sec total size is 12 speedup is 0.07 Gives the correct result: benoit@debian:~$ grep . d*/* d1/a:Hello d1/b:World d2/a:Hello d2/b:World

    Read the article

  • Word 2007 cell formatting

    - by Michelle Grant
    I have created a form template in Word 2007 which include various fields. Some of the fields are to show time (i.e. 15:47:32). I've set the text field properties as "Date" HH:mm:ss. The trouble arises when the form is them completed. If I input 15.47.32 it correctly reverts to 15:47:32 but if I input 12.12.31 it reverts to 00:00:00. This also happens if I input 12:12:32. Please help as I've looked at this all afternoon now and it's driving me insane

    Read the article

  • Setting database-agnostic default column timestamp using Hibernate

    - by unsquared
    I'm working on a java project full of Hibernate (3.3.1) mapping files that have the following sort of declaration for most domain objects. <property name="dateCreated" generated="insert"> <column name="date_created" default="getdate()" /> </property> The problem here is that getdate() is an MSSQL specific function, and when I'm using something like H2 to test subsections of the project, H2 screams that getdate() isn't a recognized function. It's own timestamping function is current_timestamp(). I'd like to be able to keep working with H2 for testing, and wanted to know whether there was a way of telling Hibernate "use this database's own mechanism for retrieving the current timestamp". With H2, I've come up with the following solution. CREATE ALIAS getdate AS $$ java.util.Date now() { return new java.util.Date(); } $$; CALL getdate(); It works, but is obviously H2 specific. I've tried extending H2Dialect and registering the function getdate(), but that doesn't seem to be invoked when Hibernate is creating tables. Is it possible to abstract the idea of a default timestamp away from the specific database engine?

    Read the article

  • how to find by date from timestamp column in JPA criteria

    - by Kre Toni
    I want to find a record by date. In entity and database table datatype is timestamp. I used Oracle database. @Entity public class Request implements Serializable { @Id private String id; @Version private long version; @Temporal(TemporalType.TIMESTAMP) @Column(name = "CREATION_DATE") private Date creationDate; public Request() { } public Request(String id, Date creationDate) { setId(id); setCreationDate(creationDate); } public String getId() { return id; } public void setId(String id) { this.id = id; } public long getVersion() { return version; } public void setVersion(long version) { this.version = version; } public Date getCreationDate() { return creationDate; } public void setCreationDate(Date creationDate) { this.creationDate = creationDate; } } in mian method public static void main(String[] args) { RequestTestCase requestTestCase = new RequestTestCase(); EntityManager em = Persistence.createEntityManagerFactory("Criteria").createEntityManager(); em.getTransaction().begin(); em.persist(new Request("005",new Date())); em.getTransaction().commit(); Query q = em.createQuery("SELECT r FROM Request r WHERE r.creationDate = :creationDate",Request.class); q.setParameter("creationDate",new GregorianCalendar(2012,12,5).getTime()); Request r = (Request)q.getSingleResult(); System.out.println(r.getCreationDate()); } in oracle database record is ID CREATION_DATE VERSION 006 05-DEC-12 05.34.39.200000 PM 1 Exception is Exception in thread "main" javax.persistence.NoResultException: getSingleResult() did not retrieve any entities. at org.eclipse.persistence.internal.jpa.EJBQueryImpl.throwNoResultException(EJBQueryImpl.java:1246) at org.eclipse.persistence.internal.jpa.EJBQueryImpl.getSingleResult(EJBQueryImpl.java:750) at com.ktrsn.RequestTestCase.main(RequestTestCase.java:29)

    Read the article

  • Check file stamp using FTP to see if it is today's file.

    - by needshelp
    Hi, I am using FTP (plain version) to download files from a server. The name of the file is always the same. All I can do to check to know if it is today's file is look at the timestamp manually. How can I write FTP script to check if the time stamp is having today's date? If you have come across this situation and have solved it, please let me know. Thank you in advance for your time.

    Read the article

  • Time Stamp and byte array

    - by JB_SO
    Hi, I'm trying to insert a timestamp (hour:min:sec) into a two-byte array and i'm a little confused on how to accomplish this...any help is greatly appreciated! int Hour = CTime::GetCurrentTime().GetHour(); int Minute = CTime::GetCurrentTime().GetMinute(); int Second = CTime::GetCurrentTime().GetSecond(); BYTE arry[2]; //Need to insert 'Hour', 'Minute', & 'Second' into 'arry' Thanks!

    Read the article

< Previous Page | 3 4 5 6 7 8 9 10 11 12 13 14  | Next Page >