Time changes when retrived from Database.

I insert the time in a string format to the database (dd-MM-yyyy hh:mm:ss). I retrive the string from database & parse it to date using .parse(string) function. But the date retrived is not the date present in database.
Database value is 15/09/2001 01:30:30
& the retrived value is 21-02-0021 01:30:30
How do i set the time difference !!!

Your .parse(string) is for some reason assuming that your date is in yy/mm/dd format. It takes day 2001 of month 9 in year 15 and normalizes that to be day 21 of month 2 in year 21. You haven't said what you are using to parse the string, but if it's a SimpleDateFormat then you need to review how you are setting it up.

Similar Messages

  • Time changes when switching from Windows to Mac, vice versa

    Hi,
    I am using Bootcamp to run Windows XP SP2 on my macbook. When ever I switch from one to the other (mac to windows, vice versa) my time will always be incorrect. I have to restart the computer everytime to switch, but when ever I just reset and load into the same OS as before, my time is fine. Anyone know what is wrong? It's really annoying to have to change the time or think its a certain time and it being wrong.

    Everyone gets that problem. Evidently Windows and Mac use a different reference point for the time, I think one uses Greenwich and the other local. On the Mac side you can go to System Prefs->Date & Time, and see if checking the box to "Set date & time automatically" fixes the problem.
    Francine
    Francine
    Schwieder

  • Html tags executed when retrived from database

    Exit
    what happens is the html executes ...........

    It is fairly difficult to answer this question, as:
    HTML is not "executed".
    A database defently does not do anything special to HTML.
    "it is multi processing using code "Huh?
    Please .... dont .... write ... like ... this
    i am also working on forum ...
    but i get these html tags executed ...
    when they are retrived and shown... OK, so you are write some forum software, and in the text area your users are putting HTML tags (<b>I'm bold</b>) and you don't want that to happen?
    A simple solution would be BEFORE you insert this data into your varchar replace all the > with &gt; < with &lt; and & with &amp;
    Message was edited by:
    mlk

  • Create link when retreive from database

    Hi, I created database called "Homepage", and i created table
    called "homenews" inside of "homepage" database.
    I also created two column which is "News_Name" and
    "News_URL".
    I use dreamweaver and is works great when i retreive from
    databse, but i want to change to have link, let say first colmn for
    "news_name i put cnn, and second colmn for News_URL i put
    www.cnn.com, my question is that how i can write php code to create
    url link of "www.cnn.com" on the text called "cnn" when retreive
    from database!
    is this is correct code!
    <?php echo '<a
    href="'.$row_HomeNews[News_URL].'">'.$row_HomeNews[News_Name
    ].'</a>'; ?>
    if so when why I'm getting errors!
    AM

    Alidad wrote:
    > Hi, I created database called "Homepage", and i created
    table called "homenews"
    > inside of "homepage" database.
    > I also created two column which is "News_Name" and
    "News_URL".
    >
    > I use dreamweaver and is works great when i retreive
    from databse, but i want
    > to change to have link, let say first colmn for
    "news_name i put cnn, and
    > second colmn for News_URL i put www.cnn.com, my question
    is that how i can
    > write php code to create url link of "www.cnn.com" on
    the text called "cnn"
    > when retreive from database!
    >
    > is this is correct code!
    >
    > <?php echo '<a
    href="'.$row_HomeNews[News_URL].'">'.$row_HomeNews[News_Name
    > ].'</a>'; ?>
    >
    > if so when why I'm getting errors!
    What errors are you getting?
    For the looks of your code, if you have www.cnn.com in the
    News_URL column, then the link you're generating will not go to
    CNN. You need to include the
    http:// as part of your link. Even though you
    can copy and paste www.cnn.com into the browser and go to the
    correct place, if it is used as a link in a page, then it has to
    have the
    http:// to go to be able to leave the current
    site and go to the correct place.
    Danilo Celic
    | Extending Knowledge Daily :
    http://CommunityMX.com/
    | Adobe Community Expert

  • N8 calendar times change when in new time zone

    How do you stop the calendar times changing when you enter a new time zone? This is very frustrating, particularly when the calendar contains flight times etc which you have entered in the local time zone of place of departure. Then when you move into that time zone it automatically changes every calendar entry! Annoying! I realise I can deselect automatic time zones, but then I'm guessing when I do change the time zone manually to where I am (so that it shows the time of day, and I can set an alarm to wake me up, etc!!!) then the same thing will happen - all my calendar entries will change. Hope someone has worked it out already.

    the times are stored on the phone in absolute time, lets call it gmt. they are then displayed on your handset in local time.
    the times aren't actually changing as you change time zones. they are very much staying the same.
    to achieve what you re after you are just going to have to enter the times in one of the text fields.
    There's no dignity in begging for kudos. Do it for the karma.

  • HT5100 How to limit the number of downloaded videos in parallel to one.i want my iPad itunesu to download only one video at once at time and when finished from downloading it to pass to the second queued one.

    How to limit the number of downloaded videos in parallel to one.i want my iPad itunesu to download only one video at once at time and when finished from downloading it to pass to the second queued one.

    @Tylerdowner: hmm.. maybe yes.. I just want to use the DOWNTHEMALL AddsOn for the saving file not the default download.. because my costumer download MP3 files and save it 3 or more files at a time so my Internet Connection goes down :( so I just want to limit them to save 1 file at a time.
    or if there is another way to limit it to 1.. please tell me :(

  • LTR - Error occurred when selecting from database

    Hi,
    We created couple of configurations using LTRC in our SLT systems. When i try to check these in transaction LTR, they are not displayed, just getting the error - Error occurred when selecting from database (Attached screenshot). All the required SICF for SLT has already been activated. Any suggestions how to fix this issue?
    Thanks,
    Saravanan

    Hi Experts,
    Did anybody get the solution of this error ,if yes please reply?
    I am getting below error when I am refreshing the current config or creating a new one in LTR
    " Error occurred when selecting from database"
    Thanks for your help,
    Balwant

  • Can FCP7 Regen Time Code when capturing from tape to allow for TC Breaks?

    Can FCP7 Regen Time Code when capturing from tape to allow for TC Breaks? Or does it start capturing with time code from the tape and then just keeps rolling regardless of TC breaks on the tape, thus not matching code after the first TC break?  I don't see any preferences where you can ask it to regenerate the code  it is writing based on the code it's receiving from the tape (i.e. continuous jam). I'm guessing it just keeps on going with the code it started with. Anyone know different?
    Thanks!

    It is not clear from your post what you want FCP to do when it encounters the timecode break on the tape that it is ingesting.
    You have three choices:
    If you choose "Make New Clip" then FCP will stop, roll the tape forward to legitimate code, and then attempt a pre-roll and start capturing again. The new clip will have timecode that corresponds to the timecode on the tape.
    If you choose "Warn After Capture", FCP will keep ingesting and the timecode will continue contiguously from the source code of your starting clip, meaning it won't match the tape after the point of the break.
    MtD

  • Date/Time erros when working with Database Connectivity toolkit

    Hi!,
    We are observing errors with date/time when working with LV. The error occurs when the system datetime format is set such that day precedes month (e.g. dd/mm/yyyy). Our VI uses LV 7.1, Database Connectivity 1.0 and SQL Server 2000 on a Win2000 machine.
    Problem details
    Our database in SQL server has a table having columns with data type "datetime"
    If the system date format (as set in control panel) is "mm/dd/yyyy", the 'insert into database' vi works fine. This function inserts the date and time (among other things) into the above mentioned table.
    However, when the system datetime is set to dd/mm/yyyy we start receiving error that date and time is beyond range for dates in which the date had the day field greater than 12 (e.g. 23/10/2005). With the same settings, if the date is such that day field is equal or less than 12 (e.g. 03/10/2005), we do not receive an error but the date is interpreted as 10 March 2005 rather than 03 September 2005.
    Clearly LV (or is it SQL) is mistaking the day field as month.
    We have taken care that when sending and receiving date, the format date and time string is set as per system settings.
    Thus, if system setting is "dd/mm/yyyy" our format string is "%d/%m/%Y"
    And if the setting is "mm/dd/yyyy" our format string is"%m/%d/%Y"
    Any help on problem cause and cure is welcome.
    Thanks,
    Gurdas
    Gurdas Singh
    PhD. Candidate | Civil Engineering | NCSU.edu

    Hi Xu,
    You answer led me to some very interesting fact finding on how SQL server handles date and time. I have attached a zip file which contains webpages that throw more light on this issue.
    The attached pages tell me that SQL has an inbuilt date/time reference format. The default in mm/dd/yyyy. Which explains why my VI worked when I used that format to write to SQL.
    However there is a catch:
    SQL expects the date/time to be in its inbuilt reference format when you WRITE data to SQL. If the date/time is in a different format, better tell SQL about it by using say the SET command you mentioned.
    BUT what about the date/time format when you are reading data from SQL?
    Our finding is that SQL sends date/time string in the system date format when you READ from SQL !!! That is very surprising behaviour (why differentiate between write and read?).
    Is our finding correct?
    So, we adopted the following simple strategy (yet to be fully tested):
    1) Whenever we write date/time to SQL, the string is formatted as mm/dd/yyyy. Presently, the user's SQL server is in the default state. Caveat is that if the user changes SQL date/time from default (which is mm/dd/yyyy) to anything else, our software will give errors. But then he changed it  ;-)
    2) When we read date/time from SQL we format the string as per system date/time format.
    I know this is not very robust coding. But assuming the user keeps his SQL in the current setting, should we expect smooth working?
    In other words, are there any errors and/or flaws in our strategy?
    Thanks,
    Gurdas
    Gurdas Singh
    PhD. Candidate | Civil Engineering | NCSU.edu

  • Resolution change when waking from Sleep

    I will at times hook up my MBP to a plasma display to show photos. Now-sometimes when waking from sleep (and not attached to an external monitor), it reverts back to 800x600. I have to go to SP to displays and re-detect the MacBook display. Unpredictable and frustrating.

    Lets get a few details straightened out first:
    1. What cable are you using to connect? DVI, VGA, HDMI, component, composite, s-video, etc.?
    2. What resolution is it when you connect? If your plasma is an HDTV, it is capable of taking much higher than 800x600, so depending on the cable you use, you can adjust that to make it higher or even the same native resolution.
    3. When you disconnect, is the computer running, or closed/sleeping? If you close, then disconnect, it might think the display is still connected. Or, rather, after switching resolutions back, later on when you open it up it suddly changes to a lower res?
    In the meantime, in system prefs, in "Displays" check the box that says "Show displays in menu bar" and then you will get a menu up top to choose your displays and resolution sizes. That will at least make it easier to change.

  • Computer Name changes when waking from sleep

    Hi,
    I'm running OS X Lion Server on a Mac Mini 2ghz Core 2 Duo and every time it wakes from sleep I get a message saying "There is already a computer on the network named MacServer, renaming to MacServer (2)".
    It only happens when waking from sleep.  If I reboot or use the mini for hours without sleeping it's fine, but once it's gone to sleep it renames on wake.  When it sleeps overnight it's named MacServer (5) by the morning, as it wakes up every two hours or so to re-register itself on the network and each time it renames itself.
    I don't have any other compters on the network with the same name.  The only other computer is a MBP and has a completly different name.
    Here's my setup;
    My Mac Mini is wired via ethernet to a Time Capsule.  AirPort is turned off (I've tried on and off).
    My Mac Mini has a static IP address (x.x.x.40) with DHCP for everything else (DNS, etc.)
    The Time Capsule is wired to an ADSL router via ethernet. 
    The ADSL router manages DHCP and NAT, with IP pool x.x.x.2 through x.x.x.30. 
    DHCP and NAT are turned off on the Time Capsule (bridged mode). 
    Wireless is turned off on the ADSL router.
    Time Capsule is handling wireless.
    I've tried resetting the ADSL router.  I've tried resetting the Time Capsule (to factory defaults).
    The problem seems to be with mDNSResponder, as the log seems to suggest that it is this daemon that thinks there's a duplicate computer name.  I've even looked at the source code for mDNSResponder and the last mod-log entry suggests that a fix was put in for this issue in 2009.  It doesn't look like it's fixed it, though.
    I've tried doing a fresh install of OS Server several times now and, after the last install, it started happening before I got a chance to restore from a Time Machine backup.  i.e. on a completly fresh install and assigning a completely new computer name.
    Can anyone help me on this issue?  It's driving me insane!

    I switched the server's WI-FI off and connected the ethernet cable to the ADSL router instead of the Time Capsule and, after several reboots, sleeps and wakes, there was no change to the server name.  The Time Capsule was still switched on, connected to the ADSL router via ethernet, and available on the network, however the server rename issue went away.
    I then took the ethernet cable out of the ADSL router, plugged it back into the Time Capssule, put it to sleep, woke it up, and guess what?  That right; 'The name of your computer "safserver" is already...renamed to "safserver (2)"'
    So, it looks like it's the Time Capsule.  I'm going to downgrade the firmware from 7.6.1 to 7.6.0 to see if the last update is responsible.  If this doesn't cure it, I'll try older firmwares and, if none of them work it's time for a Genius appointment.
    (I khow another obvious question lurks:  "why not leave it plugged into the ADSL router?"  Answer: "ADSL router doesn't supply Gigabit ethernet.")

  • Macbook pro retina color profile changes when switching from integrated to discrete

    Late 2013 macbook pro retina color profile changes when auto switching from integrated to discrete graphics card. Problem started after updating to 10.9.3

    Same here. Really annoying because I have my screen calibrated for photo editing, which makes it much warmer than the default color profile. A lot of websites cause the graphics cards to switch for a couple of seconds, which causes the profiles to switched back and forth a few times, everytime. Really annoying, and dissapointing to see, considering Apple released like a hundred .3 betas.
    You can use gfxCardStatus to make it stay on one graphics card over the other... Just remember to change it back when you're using a program that actually needs the descrete card.

  • ICal event times changed when my mac updated time to daylight saving time

    When my mac updated its time automatically to daylight saving time, the timed events in iCal all had an hour added to them. Time zone support is off in iCal. I tried changing my time zone from the system preferences (just to see what happens) and the iCal times also change. Is there any way to turn off this ridiculous and useless (to me) feature? I travel quite a bit and all iCal events are always added in local time scheduling. So there is no need for the event times to change when I change time zone!
    Thanks!

    I am having the same problem but it's only some of the appointments that were changed. I think some were entered after the update and perhaps those weren't changed. Very confusing.

  • Problem with times changing when synching to calendar

    when I sync my Ipod to my calendar program (Microsoft Outlook), the times change on the Ipod. EG, if something is on my Outlook calendar for 5 pm, it will show on my Ipod for 8 pm.

    In the Pages Preferences > Auto Correction deselect Automatic list detection.

  • Look of photos change when import from D40 into iPhoto 6

    I'm using iPhoto 6 and have a Nikon D40. I'm having a problem when I import my photos -- the image quality changes when they go from the camera into iPhoto. The images look more contrast-y, more saturated. I mean, the reds and oranges are so intense it's crazy. They definitely did not look like that when I viewed them in the camera LCD.
    I've tried checking in preferences, but can't seem to find anything that would alter the images during transfer. Would this be a camera problem? Anyone using iPhoto 6 have the same problem as I am with their D40?
    Any help would be much appreciated!

    I am having the same exact problem... iPhoto 6 and Nikon D40. If I import the photos to a folder first, then import from the folder to iPhoto, I can open the iPhoto version and then open the folder version using Preview, just by clicking on the original. I then compare the two side-by-side on the computer screen. The original always looks fine in Preview, so it is clearly a problem with iPhoto over-saturating the photos. I have no solution, but only this observation.

Maybe you are looking for