Add i hour to date

My date field have the following data:
20040805093538
I need to add one hour to the date once I get it from my cursor.
How do I do this?

Is your field datatype a date or varchar ?
If date, follow Jens' suggestion, if not you need to firstly transform this char to date then add an hour :
SCOTT@demo102> select to_date('20040805093538','YYYYMMDDHH24MISS')+1/24
  2  from dual;
TO_DATE('2004080509
05/08/2004 10:35:38
SCOTT@demo102> And to return to your original format :
SCOTT@demo102> ed
Wrote file afiedt.buf
  1  select to_char(to_date('20040805093538','YYYYMMDDHH24MISS')+1/24,'YYYYMMDDHH24MISS')
  2* from dual
SCOTT@demo102> /
TO_CHAR(TO_DAT
20040805103538Nicolas.
Sorry Indy, I didn't refresh the web page... and didn't see your post.
Message was edited by:
N. Gasparotto

Similar Messages

  • Add 1 hour to date/time field in list

    I need some help understanding the Date/Time fields in SharePoint Online. I've created a list with 2 date/time fields... StartDate and EndDate. I want the StartDate field to default to the current date/time. I want the EndDate field to default to the current
    date/time + 1 hour. I've tried numerous formulas in the default calculated value for these fields, and couldn't get it right. I finally got it, but I don't understand why. Here is the scenario:
    ***Note: Time Zone is set to UTC+5 (EST). Current Time is 8:45am
    Attempt 1:
    StartDate - Selected "Today's Date" for the Default Value
    EndDate - Selected "Calculated Value" for the Default Value. Entered the formula
    =now()+TIME(1,0,0) 
    Actual Results - StartDate: 5/28/2014 9:00am  EndDate: 5/28/2014 6:45am
    Attempt 2:
    StartDate - Selected "Calculated Value" for the Default Value. Entered the formula
    =now()
    EndDate - Selected "Calculated Value" for the Default Value. Entered the formula =now()+TIME(4,0,0) 
    Actual Results - StartDate: 5/28/2014 5:45am  EndDate: 5/28/2014 9:45am
    Attempt 3:
    StartDate - Selected "Calculated Value" for the Default Value. Entered the formula =now()+TIME(3,0,0)
    EndDate - Selected "Calculated Value" for the Default Value. Entered the formula =now()+TIME(4,0,0) 
    Actual Results - StartDate: 5/28/2014 8:45am  EndDate: 5/28/2014 9:45am
    So on attempt 3, I finally got the results that I was looking for. However, I don't understand a couple things:
    1. Why does selecting "Today's Date" for the default value, not select the current time?
    2. Why do I needed to offset the hours by 3 to get the current time?
    Thanks in advance,
    cflbasser

    The now function in my environment gives me the time in which the server is housed. If I change the regional settings it does not have an effect on the time. I'm guessing this means that your server is hosted in the UK or somewhere near there and the regional
    settings don't have an effect.
    Andy Wessendorf SharePoint Developer II | Rackspace [email protected]

  • Why does a digital indicator formatted for time & date add 16 hours to the input?

    I wire a digital indicator with a double precision value that is supposed to indicate an elapsed time. But the indicator (formatted for time and date, with the date inactive) always adds 16 hours to the wired input.
    This problem occurs even in a simple vi I wrote that only consists only of a constant wired to the indicator.
    Using LabView 6.0.2

    Labview interprets the number passed into an indicator formatted for date & time as seconds since Jan. 1st 1904. I'm assuming that since you're looking for elapsed time this is not what you're passing in. One thing that I've done is get the elapsed time in seconds and write a routine to convert that into whatever format you want.

  • Editing dates - iPhoto adds an hour!

    Hi,
    I've been editing the dates of my photos and I'm finding that iPhoto increases the hour by 1 hour. For example, I enter 10:12:35 AM and it will make it 11:12:35 AM.
    Anyone understand what it is doing?
    Also, if an developers are reading this...how about allowing users to edits EITHER the date or the time. Sometimes, I only want to make a change to one, without the other changing. (For example, it would be nice to change the hours on photos that I take in another time zone from where my camera thinks it is. Just a suggestion...
    Thanks,
    Jeff

    My iPhoto '08 under Leopard started doing the same thing immediately after the time change on Nov. 4th. I type or paste in a certain time & it adds one hour to the time.
    I hope there is an update to this bug soon as I am in the middle of manually changing the time on a couple of hundred of photos that were sent to me where the time was not set correctly (processed off of film & have date/time of when batch digitized).
    -Keith

  • How to add 5 hours to an existing date field in the database

    Have a date field 2013-11-21 00:00:00.000 but need to add 5 hours to it to make it 2013-11-21 05:00:00.000.
    Please how can I do this?
    Mijecarr

    Fantastic...
    DATEADD (hour , 5 , Cast(ActivationDate as datetime) ) worked!!!
    Thank you very much
    Mijecarr

  • Add one hour to a date variable

    Hi,
    suppose there is a variable current with 'DD-MM-YYYY HH:min:SS'
    how i can add one hour and find a new variable one_hour_later
    ?

    sql>
    select sysdate,sysdate+(1/24) added
    from dual;
    SYSDATE ADDED 
    02-02-2007 12:58:42            02-02-2007 01:58:42
    jeneesh                                                                                                                                                                                                                                                                                                                                                   

  • Add time to a Date field

    Hi,
    I have a problem where in my Database I have a date & time field. when i query this field in mysql, it looks like this
    2009-05-22 11:17:52.000
    year 2009
    month may
    date 22nd
    time 11:17  (52.000 seconds)
    I want to be able to add an hour to this field in Crystal Reports and output it on a report. So the output would look something like:
    2009-05-22 12:17:52.000
    How would I go about doing this.
    I tried doing a ToText() + '2009-05-22 12:17:52.000' but it just appends it to the end of the rigonal date.
    thanks
    J
    Sorry..I forgot to mention the DateField is a Date/Time field.
    Edited by: James Knockler on May 22, 2009 12:21 PM

    Hi!
    Try writing a formula using the following line. It works with MS SQL, sorry, I don't know if it will help in MYSQL.
    local datetimevar temp := dateadd("h",1,)
    Regards,
    David

  • How to batch add 12 hours to photos?

    Hi all,
    I'm going through my 35,000+ photos in aperture. I'm keywording, geotagging, etc. I'm looking at photos a friend shared with me from a vacation we took back in 2006. There are 395 pics. I just realized he had the AM/PM set incorrectly. I need to add 12 hours to each photo. How do I do this in Aperture 3?
    Also, will it adjust the photos' date accordingly? For example, change "12/9/2006 10:36 PM" to "12/10/2006 10:36 AM" and change "12/10/2006 12:19 AM" to "12/10/2006 12:19 PM".
    Thanks!
    Steven

    Well ... you could try a few and see if it works.
    Use "Metadata→Adjust Date & Time". Aperture does what it calls "time-shifting". All changes are identical in displacement but relative to the original date and time of each selected image. You can tell Aperture to change the date/time of the Masters as well (which will change the date/time for all Versions or each Master).
    Here's the little Help file blurb (which doesn't explain all of this):
    http://documentation.apple.com/en/aperture/usermanual/index.html#chapter=11%26se ction=10%26tasks=true

  • Add 13 hours to 500 photos using iPhoto 11 9.3.2

    My camera had the wrong time for the time zone I was in.  I need to add 13 hours to all the photos.  When I use the "batch change time" it has the option to add hours but it adds the housr between photos so I end up with one photo correct but the next one is 26 hours ahead the next one is 39 hours ahead and this goes on through all 50 photos.  So my question is can I do a batch correction of 50 photos by adding 13 hours to EACH photo.
    I thought Apple was the cats meow, so I hope someone out there can help me.  I will be looking for third party app help in the mean time.

    Try use 'Adjust Date and Time'.

  • I would like to add a new card date field to my address Book Contacts. Is this possible? Thanks, Jeff

    Hi,
    I would like to add a new card date field to my Address Book Contacts. Is there any way to do this? I have a lot of contacts and it helps me remember who I talked to, if I had a new card date field in my contacts.
    Thank you,
    Jeff

    Hi,
    I found the applescript below from Michael Bach that works well.
    (* Find recently modified entries in the Address Book
    Input: a time interval (backwards from today) in the variable "daysBeforeToday"
    Output: a string on the clipboard, format: YYYY-MM-DD (tab) Name (return)
    ©2009, Michael Bach, <www.michaelbach.de> *)
    set daysBeforeToday to 7 -- <<<  change as desired or read from a dialog
    tell application "Address Book"
      copy (current date) - daysBeforeToday * 24 * minutes * 60 to referenceDate
      copy (every person whose (modification date > referenceDate)) to modifiedPersons
      set s to ""
      repeat with aPerson in modifiedPersons
        set d to ((modification date) of aPerson) -- now change to international format and forget the hours
        set dateString to (year of d as string) & "-" & (my twoDigits((month of d) as number)) & "-" & (my twoDigits(day of d) as string)
        set s to s & dateString & tab & (name of aPerson) & return
      end repeat
      set the clipboard to s --for pasting into other applications
      s -- to view immediately in the script editor
    end tell
    on twoDigits(aNumber) -- trivial utility for formatting
      if aNumber < 10 then return "0" & (aNumber as string)
      return (aNumber as string)
    end twoDigits
    I changed the modification date to creation date.
    Thanks for the replies.

  • ICal adds 2 hours when importing

    Hi!
    I created a new calendar in iCal and named it after my son. Went into to homepage for his footballteam and made an iCalexport, .ics-file. Went into iCal and choose my sons calendar and imported it. All OK.
    Then I made exactly the same thing for my daughter BUT that import puts all the events 2 hours after the actual time. In the description of the event I can read the correct time.
    Then I opened the two different files in Excel and compared the information on a particular date and it says the same, correct, information in the file but when I import my daughters file it adds 2 hours!! They have the same Timezone, Daylight etc in the file.
    This drives my crazy. What has gone wrong? Hope somebody can help me.

    hi
    i guess you are in the wrong time zone with your K750i.
    try these settings:
    iCal: in "system preferences": clock: set time zone to CEST (stockholm, sweden)
    K750i: settings for "time and date": "time zone" set to GMT + 2.00h and setting for "daylight saving" set to "standard time". don't set it to "Daylight saving" cuz it doesn't work properly then with iCal.
    if your time on the K750i is wrong now, correct it in the section "time". but don't change the "time zone" anymore.
    hope you got my meaning. apologizing for my english.
    now, it should work. at least, my iCal and K750i do
    Regards

  • Adding an hour to Date

    How can i add an hour to a java.util.Date? I've searched the forum, but found only GregorianCalendar, which seems to only deal with adding and subtracting dayz..
    newio

    Date d = new Date(103, 4, 3);
    d.setHours(d.getHours() + 10);
    Calendar c = Calendar.getInstance();
    c.set(Calendar.HOUR, c.get(Calendar.HOUR) + 10);

  • How can I display a constant 1 hour of data in my VI

    I am currently designing a VI which reads data from a spreadsheet which is being updated from another source.
    I currently have my VI reading the information and displaying it on waveform charts.
    I have 13 sample points each of which has a chart of its own. I wish to plot the data and be able to review it whilst it is running which is not a problem as I have activated the scroll bar function within the chart.
    Now the task I wish to achieve next is to only have a certain amount of history data to review eg 1 hour of data.
    So if I have been running the VI for 8 hours there will still only be the previous 1 hours data to review.
    Can anybody help with how to achieve this? Has anybody else needed to do anything like this?
    Thanks in advance

    Hi n_,
    Would this not keep all of the data plotted stored in memory somewhere?
    That depends on how you created/control those buffers…
    I wish to use this to monitor a process constantly over years
    So you need to limit the history length of your charts or use your own buffers…
    (When it needs to run for "years" you should NOT use a Windows PC and you should stay away from any BuildArray function.)
    Best regards,
    GerdW
    CLAD, using 2009SP1 + LV2011SP1 + LV2014SP1 on WinXP+Win7+cRIO
    Kudos are welcome

  • Trying to add month with a Date

    Hi All,
    I am trying to add month with a date. it will take the earlier month and add one month . Here is my code
    declare @CollectionDate date='10-30-2014'
    select @CollectionDate
    ;WITH CTemp AS (
    SELECT TransactionDate=CAST(@CollectionDate AS DATE) ,RemainingTransaction=1
    UNION all
    SELECT TransactionDate=DATEADD(MONTH,1,CONVERT(date, CONVERT(varchar(4), YEAR(TransactionDate))
    +'-'+CONVERT(varchar(2),MONTH(TransactionDate))
    +'-'+ CONVERT(varchar(2),DATEPART(day, @CollectionDate)))),
    RemainingTransaction+1
    FROM CTemp
    WHERE RemainingTransaction < 9
    select * from CTemp
    When I am giving date 10-28-2014 then it is working fine. But when the date is 10-31-2014 then it shows me the error
    Msg 241, Level 16, State 1, Line 3
    Conversion failed when converting date and/or time from character string.
    I can undestand it is for the month of February but how do I overcome it?
    Can anyone help me on this?
    Thanks in advance!!
    Niladri Biswas

    Try the below:
    --To find the last day of the month, use the below:
    declare @CollectionDate date='10-30-2014'
    select @CollectionDate
    ;WITH CTemp AS (
    SELECT TransactionDate=CAST(@CollectionDate AS DATE) ,RemainingTransaction=1
    UNION all
    SELECT TransactionDate=cast(DATEADD(day,-1,DATEADD(month,MONTH(Transactiondate)-1,DATEADD(year,YEAR(TransactionDate)-1900,0))) as DATE),
    RemainingTransaction+1
    FROM CTemp
    WHERE RemainingTransaction < 9
    select * from CTemp
    --Just to add a month, use the below
    declare @CollectionDate date='10-30-2014'
    select @CollectionDate
    ;WITH CTemp AS (
    SELECT TransactionDate=CAST(@CollectionDate AS DATE) ,RemainingTransaction=1
    UNION all
    SELECT TransactionDate=DATEADD(month,-1,TransactionDate),
    RemainingTransaction+1
    FROM CTemp
    WHERE RemainingTransaction < 9
    select * from CTemp
    EDIT: You may change -1 to 1 if you want the future months.(I am bit confused whether you are looking for previous months or future months.)

  • How do I store 4 hours of data and get it out of the "while loop" into a spreadshee​t file for documentin​g purposes? "See additional Text for additonal info"

    What a have is a VI that uses the following SUbvi's, starts with FP OpenVI, then FP Create TagVI, into a "While Loop" which contains a FP ReadVI outputting data into a Index ArrayVI outputting to a Display (DBL). This shows the output of a FP-AI-100 monitoring a 9v battery. I have to monitor this battery for a 4 hour period my problem is storing the 4 hours of data and getting it out of the "while loop" into a "Write to Spreadsheet File VI" all I seem to accomplish is just one data sample which I get into a spreed ship file with no problem. I just can't get 4 hours worth. By the way this is my first VI and I'm self
    trained so have mercy.

    I figured it out thanks.
    John Morris
    Glendinning Marine

Maybe you are looking for

  • Plug-in conflicts

    I apologize in advance. I�m a newbie to this forum and I am not a java programmer. Additionally, I was not sure which forum to post this to. If, after reading this, you believe it should be posted to a different forum, please let me know. I am deploy

  • Inversions at posting level 20

    Hi Greg, i like the look of your blog and I will read it when I get some more time (probably after my current project). At first glance I have a question for you, why would the following impact the I/S? Dr intercompany payable                110 Cr i

  • Adding multiple in sales order using fm crm_order_maintain

    hi experts, we have requirement of creating sales order with multiple products. We used FM CRM_ORDER_MAINTAIN to avhieve the same. But problem that we are facing is we are able to add only one product in sales order through this function module. But

  • Spry Menu being covered by embedded video

    I embedded a video on my homepage, but when my spry menu flys out to the right, the submenus are covered by the video. Shouldn't the video be under the submenus since it's part of my page's DIV? If the DIV that the video is in had text, that text wou

  • Photo taken is gone.

    Hi, I took a photo from the camera app. But when I checked my photo album, it is not there. I'm using iphone 5s running ios 7.1.2 and I open my camera app on the lock screen. (I tried taking a photo again and it works, the photo was on the album) Did