date

Groovy Sql and SimpleDateFormat help

In my database, I have a column type : datetime. Column data example : 2009-02-03 19:04:23.0 I'm using : SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss.S"); to define my date format. I'm using groovySQL to read tables and for each rows, I'm adding a new SampleJ object (mapped to a new table - SampleJ). Here my...

Working with date and time

I have a UTC date of Tue, 16 Feb 2010 03:12:02 UTC +00:00, for example. I want to add 168 hours to this date to get a future UTC date. What's the best way to do that? ...

How sort elements and store them in a variable, XSLT

Hello everyone, I was wondering whether it's possible to sort some elements first and store them (already sorted) in a varible. I would need to refer to them thought XSLT that's why I'd like to store them in a variable. I was trying to do the following, but it doesn't seem to work <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/...

How to generate year in Smarty?

How can i generate a select list with the given year till this year? i did this {assign var=thisyear value=$smarty.now|date_format:"%Y"} {if !$firstyear} {assign var=firstyear value="2003"} {/if} {if !$loop}{assign var=loop value=$thisyear}{/if} <select name='{$id|default:year}' id={$id|default:year} style='width:70px;'> {section na...

Convert javascript to date object to mysql date format (YYYY-MM-DD)

I'm trying to use javascript to convert a date object into a valid mysql date - what is the best way to do this? ...

Oracle week calculation issue

I am using Oracle's to_char() function to convert a date to a week number (1-53): select pat_id, pat_enc_csn_id, contact_date, to_char(contact_date,'ww') week, ... the 'ww' switch gives me these values for dates in January of this year: Date Week 1-Jan-10 1 2-Jan-10 1 3-Jan-10 1 4-Jan-10 1 5-Jan...

How to handle time in Java

Hi, I'm working on a functionality related to job scheduling in Java, where I'm required to schedule jobs based on days, weeks, or hours. I'm running into 2 problems: What is a good representation/library to handle a duration of time (not date)? What is a good library to parse a text representation of time, i.e. 2d 3wk for 3 weeks a...

How do I insert a date into mysql as a parameter?

I have the following code: function dbInsert() { global $dbcon, $dbtable; global $inputData; $sqlQuery = 'INSERT INTO ' . $dbtable . ' (id_author, date, title, description) VALUES (?, ?, ?, ?)'; $stmt = $dbcon->prepare($sqlQuery); echo $sqlQuery; $stmt->bind_param('isss', $inputData['idAuthor'], $inputData['date...

Find average date from collection of dates (Ruby)

Hey guys, I have a table of guesses, within each guess is just a date. I was wondering how I would go about turning two or more dates into an average. <div id="logic"> <% foo = Date.today %> <% bar = Date.today + 10 %> <%= (foo + bar) / 2 %> Something like this, but obviously Ruby wont let me divide the two dates, any help much appr...

Japanese Date in this format

I'm wanting show the Date in Japanese in this format: 2010年2月18日(木) which translates to: February 18, 2010 (Thu) in PHP can anyone help? Thanks ...

BASH: How do you "split" the date command?

Cygwin user here (though if there's a suitable solution I will carry it over to K/Ubuntu, which I also use). I have a Welcome message in my .bashrc that looks like the following: SAD=(`date +%A-%B-%d-%Y`) DUB=(`date -u +%k:%M`) printf "Today's Date is: ${SAD}.\n" printf "Dublin time is now ${DUB}. (24-Hour Clock)\n" After numerous at...

Is there a benefit to using Julian Dates in code?

I maintain a PHP/Flash app that uses Julian dates within the code and only converts to Gregorian for display. Before I replace the integer Julian dates with a Date data-type I was wondering if there was a benefit to using the Julian? Should this even be changed? One of the problems is being able to quickly look at dates in the database....

What is the Oracle date formatting mask for time zones?

I need to insert a date format from an outside source which includes the three letter code for time zone, but the TZD formatting mask does not seem to work... insert into blah values (to_date('Thu, 18 Feb 2010 08:37:00 EST','Dy, DD Mon YYYY HH24:MI:SS TZD')); ORA-01821: date format not recognized If I remove the "TZD"... insert ...

How to handle a Datetime column while reading from a .csv file through java code

While reading a date column from a .csv file which is of 'dd/mm/yyyy hh:mi:ss am' format through javacode. I declared the variable as Long in javacode. how to parse in the javacode. ...

Generating recurring dates using python?

How can I generate recurring dates using Python? For example I want to generate recurring date for "Third Friday of every second month". I want to generate recurring dates for daily, weekly, monthly, yearly (i.e., same as the recurrence function in Outlook Express). ...

How to convert Regular Date to unixtime in Javascript?

How can i convert date which looks like this 12092008 to unixtime like this 1221215809 ...

Will PHP DateInterval support decimals to add to a date/time?

According to wikipedia - en.wikipedia.org/wiki/ISO_8601 , it should be possible to do this (assuming PHP supports the full ISO 8601): $date = new DateTime(date('Y-m-d H:i:s', time())); // current time - create date time object date_add($date, new DateInterval("PT".round(2.5,2)."H")); //add 2.5 hours (throws exception unknown or bad form...

How to print the date in iphone?

I am new to iphone development.I am having array of date .I want to print the date in my console.But I didn't want to convert it into a string and print it.I want to print as a date.How can i achieve that.Please help me out thanks. ...

How to avoid unrecognised selector sent to NSCFArray sortUsingDescriptor: in iphone?

I am new to iphone development .I am trying to sort a NSMutable array with reference to the date which is saved as object for the key "pubDate".After parsing the url i am saving the date as date format in an array"myPubDate". (void)parser:(NSXMLParser *)parser foundCharacters:(NSString *)string{ //NSLog(@"found characters: %@", string)...

How to store parsed date value as date format in mutable array as mutable dictionary in iphone?

I am new to iphone development .I have parsed a xml page and stored the title, date, summary, in a mutable array "stories" as mutable dictionary "object for key".All the values are saved as string But i want to save the Date value as date format.So that i can sort it with date.How can i achieve that.Please help me out.Thanks ...