Date & Time Problems

I'm having a frustrating problem with the MacBook. I like to have the time showing in the menu bar and have checked the "show Date & Time" box in the system preferences (even clicked the lock to prevent changes), but every few restarts of the computer, the date and time disappears and I have to go back into system preferences and add it again! This has been going on for months and is driving me up the wall! Has anyone had a similar problem and know how to fix it?
I've tried reparing the permissions as well as resetting the PRAMs, but nothing has seemed to work yet.
Cheers,
Candice

Thanks for the advice.. it's a little tough to tell, because it comes and goes after a fair number of restarts... sometimes I set it to show in the menu and one restart later it's gone, sometimes it takes 5 - 10 restarts before I find that it's disappeared again. If I start up in safe mode, will something get fixed and can start up normally for future starts?
I have two user accounts on the computer and the problem is there for both. I've turned date and time on for both accounts.
Cheers,
Candice

Similar Messages

  • Date/Time Problem Results In Spinning Wheel

    My mom's eMac recently was shutdown during a power outage, and came back with the date/time reset problem (I'm familiar with this when my battery comes loose on my iBook).
    Only problem is, if I try to launch System Preference or Open Date & Time I get the spinning wheel that doesn't allow me to reset the date/time. On top of that, I can't seem to get anything to launch right now b/c it seems Finder is what's getting the spinning wheel. The only thing that launches is AIM (which is on autolaunch), but it can't be accessed at all from the computer (though it does show up as signed on when I'm signed on to AIM at work).
    I've tried a force quit to relaunch finder with no results, and have also blasted the PRAM and tried the instructions for resetting the PMU (if I'm doing that right).
    One thing I can across is the possibility I need to replace the internal backup battery. Could that be the problem, or have I run into soemthing much more serious.
    Any help would be appreciated.

    Hello! A power outage often damages the disk's directory information. Boot from the install disc ("c" key down at startup with disc inserted) and right after the language screen navigate through the drop down menus to the disk utility and repair the disc. Run the repair multiple times if it reports errors until it doesn't report errors. Tom

  • Insert current date/time problem in ViewObject

    Hi!
    I'm trying to setAttribute to a Date type field.
    I have a method:
    public String getCurrDateString() throws ParseException, java.sql.SQLException {
    SimpleDateFormat formatter = new SimpleDateFormat ("dd-MMM-yyyy hh:mm:ss aa");
    Date currentTime_1 = new Date();
    return formatter.format(currentTime_1);
    All the time i call this method such as:
    HistoryViewImpl histVO=getHistoryView();
    Row r=histVO.createRow();
    r.setAttribute("Entrydatetime",cp.getCurrDateString());
    I get oracle.jbo.domain.DataCreationException: JBO-25009: Cannot create an object of type:oracle.jbo.domain.Date with value:19-Jun-2002 10:14:33 AM
    the strange thing is, that Oracle recognizes this kind of format, because if I use different pattern such as "yyyy-MM-dd", which returns string "2002-06-19", r.setAttribute("Entrydatetime",cp.getCurrDateString()) method works fine and in Oracle table field we have inserted value 19-Jun-2002 12:00:00 PM. The problem is, that i don't need 12:00:00 PM as a time, i need current time.
    What am i doing wrong? Or does it mean that oracle.jbo.domain.Date doesn't know format "dd-MMM-yyyy hh:mm:ss aa"?

    Hi!
    I'm trying to setAttribute to a Date type field.
    I have a method:
    public String getCurrDateString() throws ParseException, java.sql.SQLException {
    SimpleDateFormat formatter = new SimpleDateFormat ("dd-MMM-yyyy hh:mm:ss aa");
    Date currentTime_1 = new Date();
    return formatter.format(currentTime_1);
    All the time i call this method such as:
    HistoryViewImpl histVO=getHistoryView();
    Row r=histVO.createRow();
    r.setAttribute("Entrydatetime",cp.getCurrDateString());Instead of passing in the "String" pass the date object as is. oracle.jbo.domain.Date should be able to convert java.sql.Date/Time/Timestamp and store the time bits as set.
    If you have to pass in string, then establish a Formatter on the attribute with appropriate date format and then use the AttributeHints interface from the relevant AttributeDef object on the row to parse the input String into a valid parsed object that you can set into the row.
    (See oracle.jbo.uicli.binding.JUCtrlValueBinding.setAttributeInRow() method for a complete usage - source in bc4j\src\bc4juisrc.zip)
    I get oracle.jbo.domain.DataCreationException: JBO-25009: Cannot create an object of type:oracle.jbo.domain.Date with value:19-Jun-2002 10:14:33 AM
    the strange thing is, that Oracle recognizes this kind of format, because if I use different pattern such as "yyyy-MM-dd", which returns string "2002-06-19", r.setAttribute("Entrydatetime",cp.getCurrDateString()) method works fine and in Oracle table field we have inserted value 19-Jun-2002 12:00:00 PM. The problem is, that i don't need 12:00:00 PM as a time, i need current time.
    What am i doing wrong? Or does it mean that oracle.jbo.domain.Date doesn't know format "dd-MMM-yyyy hh:mm:ss aa"?

  • 'New' Exchange Battery not holding charge - Date & Time problems

    I recently received a 'new' exchange battery for my 2001 500mhz white ibook (OSX 10.3.9, 320ram), as part of the Battery Exchange program, and now I'm having some new problems.
    Since I started using the battery a few weeks ago, I've been having constant problems with the Date & Time reseting itself to 1969. I reset to current time, but when I turn on again, it's resets back again. Also, this battery is not holding a charge very well, lasting only about 40 minutes after fully charged (My old battery lasted 2 hours).
    I calibrated the battery when i first received it, and I've reset the PMU twice, but no luck.
    Thanks in advance for any help & advice....
    ibook (500mhz 2001)   Mac OS X (10.3.9)  

    Is there any such program for the G3s?
    Only if you replaced your original battery with one from Apple within a certain time frame and within a specific range of serial numbers. Check out the details here:
    https://depot.info.apple.com/batteryexchange/index.html

  • Date & time problems after new year

    Hi,
    First of all, HAPPY NEW YEAR!
    After the new year my date and time is always changing to a date in the year 1969. I do reset it whenever I turn my pb on. But it always goes back when I turn it off. What could be the reason?

    Hi, zoha. Your internal PRAM battery is dead and needs to be replaced. It's just coincidental that it happened to die at the end of the year.

  • Time Zone and WLS6SP1 and date time problem

    Hi,
    We are having our development WebLogic server on a Solaris 2.8 machine. The time
    zone of that machine is GMT+5
    How ever when we start weblogic in the telnet console, we see this
    LD_LIBRARY_PATH=.......
    <Jul 5, 2001 1:19:46 AM GMT-05:00> <Info> <Security> <Getting boot password from
    user.>
    Enter password to boot WebLogic server:
    It shows the time as GMT-5.
    All our application client machines are at GMT+5.30.So when we update from our
    application, the datetime fields go as one day lesser(we have our own serializable
    component which does the updating). If i enter Dec 10 2000 in our applet client
    and try updating, it goes as Dec 9 2000 into the database.
    We tried on a NT machine which had GMT+5.30 as the time zone and it showed GMT+5.30
    while starting weblogic. And the dates are updated properly.
    Does WLS on Solaris take the timezone,etc from some other place?
    Is there any workaround for this?
    Thanks in Advance,
    Ramkumar

    We had the same thing using ReflectionX to connect. Users connection with Telnet
    caused weblogic to log with the default timezone ( which included the effects of
    daylight savings time ), while those users who connected with Rexec caused weblogic
    to use GMT in its logging. This was with weblogic 6.0 sp2
    "Joe" <[email protected].spam.com> wrote:
    >
    How are you starting up your server? We had a similar situation at our
    site, and
    it was due to the fact that we were using exceed to log into our sun box.
    Exceed
    was grabbing the users timezone info off of his/her local windows box.
    is this what is happening for you?
    "Ramkumar" <[email protected]> wrote:
    Hi,
    We are having our development WebLogic server on a Solaris 2.8 machine.
    The time
    zone of that machine is GMT+5
    How ever when we start weblogic in the telnet console, we see this
    LD_LIBRARY_PATH=.......
    <Jul 5, 2001 1:19:46 AM GMT-05:00> <Info> <Security> <Getting boot password
    from
    user.>
    Enter password to boot WebLogic server:
    It shows the time as GMT-5.
    All our application client machines are at GMT+5.30.So when we update
    from our
    application, the datetime fields go as one day lesser(we have our own
    serializable
    component which does the updating). If i enter Dec 10 2000 in our applet
    client
    and try updating, it goes as Dec 9 2000 into the database.
    We tried on a NT machine which had GMT+5.30 as the time zone and it
    showed GMT+5.30
    while starting weblogic. And the dates are updated properly.
    Does WLS on Solaris take the timezone,etc from some other place?
    Is there any workaround for this?
    Thanks in Advance,
    Ramkumar

  • PB 15" won't Boot/Loses Date & Time

    I have a 15" PB 15" that runs fine for a few days on either battery or AC, then suddenly won't boot (apple logo w/spinning gear). I can get it running again after running Disk Warrior (from a Fire Wire drive), but notice that when booting from that FW drive that a message pops up informing me that date & time was set to a date prior to 2001. Anyhow, after rebuilding by DW, the system runs fine for a few days, but then reverts back to the same problem.
    I should note that after booting from the FW drive, and before running DW, I could not run Disk Utility on the problem MacintoshHD because, while it showed the drive, Permission Repair was greyed out, not allowing me to access the problem drive. Sustem does, BTW, boot from CD also. The fact that it boots from CD and FireWire drives leads me to believe that the internal HD is my problem. I'm scared. however, about the message that date & time was changed at the time of failure.
    Would (or could) the date & time be lost if problem was limited to the HD ? I ordered a new HD, and hope that the problem is not the Logic Board. FWIW, I have done the PMU reset procedure, and that didn't solve anything.

    Okay, it seems the problem is resolved, and the cause seems to have been a bad 256Mb DIMM. At least that's all I can imagine it was. I still hadn't gotten around to replacing the HDD nor the clock battery. While waiting to receive these two parts, I removed the replaced the second memory DIMM (a 256Mb) with a 1GB. and it's been running about a week with no problems. (I even accidentally dropped the PB yesterday, and it's STILL functioning fine. I can only imagine that the 256 DIMM was flaky, yet passing all diagnostics. Maybe the loss of date & time problem was caused by the machine not having been used for a long time prior to my purchase a few weeks ago. (Is that battery a re-chargable one?) Maybe now that I have the machine on each day, it remains charged enough to hold the data.
    Anyhow, I'm going to upgrade the HDD from 80 to 160 and hold onto the spare clock battery just in case. Thanks for the help guys. Walt

  • [8i] Date/Time calculation problem...

    So, I am currently facing a situation where I need to calculate the total hours a workstation is in use for each day in a particular time period. I have a table with the log of each time each workstation is used. The problem is, a workstation can be used for any amount of time, starting on any day and ending on any day. This means that a particular entry in the log can span multiple days. I'm not sure how to split the difference between the end date/time of an entry and the start date/time of the entry over multiple days.
    Here's a sample table and some sample data for what I'm trying to do:
    -- Note: in reality, this table contains more columns
    CREATE TABLE     my_hrs
    (     record_id     NUMBER     NOT NULL
    ,     sdatetime     DATE     
    ,     edatetime     DATE     
    ,     workstation     VARCHAR2(4)
         CONSTRAINT my_hrs_pk PRIMARY KEY (record_id)
    -- Note: sdatetime, edatetime, and workstation CAN all be NULL, though I won't provide
    -- any sample data for these situations since I want to ignore them in my results
    -- Additionally, there are hundreds of workstations, but I'm only using 2 to simplify the sample data
    INSERT INTO     my_hrs
    VALUES (12345,TO_DATE('03/01/2010 08:00','mm/dd/yyyy HH24:MI'),TO_DATE('03/01/2010 13:35','mm/dd/yyyy HH24:MI'),'123A');
    INSERT INTO     my_hrs
    VALUES (13427,TO_DATE('03/01/2010 08:10','mm/dd/yyyy HH24:MI'),TO_DATE('03/01/2010 10:02','mm/dd/yyyy HH24:MI'),'321B');
    INSERT INTO     my_hrs
    VALUES (21543,TO_DATE('03/01/2010 14:07','mm/dd/yyyy HH24:MI'),TO_DATE('03/01/2010 16:30','mm/dd/yyyy HH24:MI'),'123A');
    INSERT INTO     my_hrs
    VALUES (22412,TO_DATE('03/01/2010 10:15','mm/dd/yyyy HH24:MI'),TO_DATE('03/01/2010 15:30','mm/dd/yyyy HH24:MI'),'321B');
    INSERT INTO     my_hrs
    VALUES (11976,TO_DATE('03/01/2010 17:00','mm/dd/yyyy HH24:MI'),TO_DATE('03/02/2010 02:30','mm/dd/yyyy HH24:MI'),'123A');
    INSERT INTO     my_hrs
    VALUES (34215,TO_DATE('03/01/2010 22:10','mm/dd/yyyy HH24:MI'),TO_DATE('03/02/2010 04:30','mm/dd/yyyy HH24:MI'),'321B');
    INSERT INTO     my_hrs
    VALUES (24789,TO_DATE('03/02/2010 13:00','mm/dd/yyyy HH24:MI'),TO_DATE('03/05/2010 02:30','mm/dd/yyyy HH24:MI'),'123A');
    INSERT INTO     my_hrs
    VALUES (31542,TO_DATE('03/02/2010 21:30','mm/dd/yyyy HH24:MI'),TO_DATE('03/04/2010 10:30','mm/dd/yyyy HH24:MI'),'321B');Based on my sample data above, these are the results I want to see:
    WORKSTATION     DATE          HRS_IN_USE
    123A          3/1/2010     14.96667
    321B          3/1/2010     8.95000
    123A          3/2/2010     13.50000
    321B          3/2/2010     7.00000
    123A          3/3/2010     24.00000
    321B          3/3/2010     24.00000
    123A          3/4/2010     24.00000
    321B          3/4/2010     10.50000
    123A          3/5/2010     2.50000
    321B          3/5/2010     0.00000Is this possible? (Please note, if the workstation was not used on a particular day, I want it to show 0 hours for that workstation for that day). Another thing to note is that I'm working with Oracle 8i.
    Thanks in advance for the help!

    Thanks, Frank, your explanation helped. My main problem was just that I couldn't picture what that line of the query was doing, even working from the inside out. I learn better through visual and hands-on methods, so to really understand, I had to look at the cross-join of a and h and go line by line. (In case there's anybody who looks at this post in the future and learns like I do, I've posted that data below).
    This definitely solves my problem!
    >
    By the way, this query is full of things that could be done better in later versions of Oracle. Generating table a is just one of them. Starting in Oracle 9, you can do a CONNECT BY query on dual to generate exacly how many rows you need. You never have to worry about an upper bound, and it's much faster than using ROWNUM. From time to time you might gently remind the people who decide these things that you're using a very old, unsupported version of Oracle, and that everyone could be more productive if you upgraded.
    >
    I could go on and on on this topic.... we have tried and continue to try to convince the powers that be to pay for the upgrades... if it were just Oracle that needed to be upgraded, we might actually have a chance at succeeding. As it is, ...ha.
    TABLE A (FROM SUB-QUERY)
    a_date          next_date
    3/1/2010     3/2/2010
    3/2/2010     3/3/2010
    3/3/2010     3/4/2010
    3/4/2010     3/5/2010
    3/5/2010     3/6/2010
    TABLE H (MY_HRS)          
    record_id     sdatetime     edatetime     workstation
    10000          2/28/2010 18:00     3/1/2010 5:30     123A
    12345          3/1/2010 8:00     3/1/2010 13:35     123A
    13427          3/1/2010 8:10     3/1/2010 10:02     321B
    21543          3/1/2010 14:07     3/1/2010 16:30     123A
    22412          3/1/2010 10:15     3/1/2010 15:30     321B
    11976          3/1/2010 17:00     3/2/2010 2:30     123A
    34215          3/1/2010 22:10     3/2/2010 4:30     321B
    24789          3/2/2010 13:00     3/5/2010 2:30     123A
    31542          3/2/2010 21:30     3/4/2010 10:30     321B
    CROSS-JOIN TABLE A WITH TABLE H                                             (and calculations done by the query below)     
    record_id     sdatetime     edatetime     workstation     a_date          next_date     LEAST (h.edatetime, a.next_date)     GREATEST (h.sdatetime, a.a_date)     GREATEST(TO_NUMBER(L-G),0)
    10000          2/28/2010 18:00     3/1/2010 5:30     123A          3/1/2010     3/2/2010     3/1/2010 5:30                    3/1/2010 0:00                    0.229166667
    10000          2/28/2010 18:00     3/1/2010 5:30     123A          3/2/2010     3/3/2010     3/1/2010 5:30                    3/2/2010 0:00                    0.00000
    10000          2/28/2010 18:00     3/1/2010 5:30     123A          3/3/2010     3/4/2010     3/1/2010 5:30                    3/3/2010 0:00                    0.00000
    10000          2/28/2010 18:00     3/1/2010 5:30     123A          3/4/2010     3/5/2010     3/1/2010 5:30                    3/4/2010 0:00                    0.00000
    10000          2/28/2010 18:00     3/1/2010 5:30     123A          3/5/2010     3/6/2010     3/1/2010 5:30                    3/5/2010 0:00                    0.00000
    12345          3/1/2010 8:00     3/1/2010 13:35     123A          3/1/2010     3/2/2010     3/1/2010 13:35                    3/1/2010 8:00                    0.23264
    12345          3/1/2010 8:00     3/1/2010 13:35     123A          3/2/2010     3/3/2010     3/1/2010 13:35                    3/2/2010 0:00                    0.00000
    12345          3/1/2010 8:00     3/1/2010 13:35     123A          3/3/2010     3/4/2010     3/1/2010 13:35                    3/3/2010 0:00                    0.00000
    12345          3/1/2010 8:00     3/1/2010 13:35     123A          3/4/2010     3/5/2010     3/1/2010 13:35                    3/4/2010 0:00                    0.00000
    12345          3/1/2010 8:00     3/1/2010 13:35     123A          3/5/2010     3/6/2010     3/1/2010 13:35                    3/5/2010 0:00                    0.00000
    13427          3/1/2010 8:10     3/1/2010 10:02     321B          3/1/2010     3/2/2010     3/1/2010 10:02                    3/1/2010 8:10                    0.07778
    13427          3/1/2010 8:10     3/1/2010 10:02     321B          3/2/2010     3/3/2010     3/1/2010 10:02                    3/2/2010 0:00                    0.00000
    13427          3/1/2010 8:10     3/1/2010 10:02     321B          3/3/2010     3/4/2010     3/1/2010 10:02                    3/3/2010 0:00                    0.00000
    13427          3/1/2010 8:10     3/1/2010 10:02     321B          3/4/2010     3/5/2010     3/1/2010 10:02                    3/4/2010 0:00                    0.00000
    13427          3/1/2010 8:10     3/1/2010 10:02     321B          3/5/2010     3/6/2010     3/1/2010 10:02                    3/5/2010 0:00                    0.00000
    21543          3/1/2010 14:07     3/1/2010 16:30     123A          3/1/2010     3/2/2010     3/1/2010 16:30                    3/1/2010 14:07                    0.09931
    21543          3/1/2010 14:07     3/1/2010 16:30     123A          3/2/2010     3/3/2010     3/1/2010 16:30                    3/2/2010 0:00                    0.00000
    21543          3/1/2010 14:07     3/1/2010 16:30     123A          3/3/2010     3/4/2010     3/1/2010 16:30                    3/3/2010 0:00                    0.00000
    21543          3/1/2010 14:07     3/1/2010 16:30     123A          3/4/2010     3/5/2010     3/1/2010 16:30                    3/4/2010 0:00                    0.00000
    21543          3/1/2010 14:07     3/1/2010 16:30     123A          3/5/2010     3/6/2010     3/1/2010 16:30                    3/5/2010 0:00                    0.00000
    22412          3/1/2010 10:15     3/1/2010 15:30     321B          3/1/2010     3/2/2010     3/1/2010 15:30                    3/1/2010 10:15                    0.21875
    22412          3/1/2010 10:15     3/1/2010 15:30     321B          3/2/2010     3/3/2010     3/1/2010 15:30                    3/2/2010 0:00                    0.00000
    22412          3/1/2010 10:15     3/1/2010 15:30     321B          3/3/2010     3/4/2010     3/1/2010 15:30                    3/3/2010 0:00                    0.00000
    22412          3/1/2010 10:15     3/1/2010 15:30     321B          3/4/2010     3/5/2010     3/1/2010 15:30                    3/4/2010 0:00                    0.00000
    22412          3/1/2010 10:15     3/1/2010 15:30     321B          3/5/2010     3/6/2010     3/1/2010 15:30                    3/5/2010 0:00                    0.00000
    11976          3/1/2010 17:00     3/2/2010 2:30     123A          3/1/2010     3/2/2010     3/2/2010 0:00                    3/1/2010 17:00                    0.29167
    11976          3/1/2010 17:00     3/2/2010 2:30     123A          3/2/2010     3/3/2010     3/2/2010 2:30                    3/2/2010 0:00                    0.10417
    11976          3/1/2010 17:00     3/2/2010 2:30     123A          3/3/2010     3/4/2010     3/2/2010 2:30                    3/3/2010 0:00                    0.00000
    11976          3/1/2010 17:00     3/2/2010 2:30     123A          3/4/2010     3/5/2010     3/2/2010 2:30                    3/4/2010 0:00                    0.00000
    11976          3/1/2010 17:00     3/2/2010 2:30     123A          3/5/2010     3/6/2010     3/2/2010 2:30                    3/5/2010 0:00                    0.00000
    34215          3/1/2010 22:10     3/2/2010 4:30     321B          3/1/2010     3/2/2010     3/2/2010 0:00                    3/1/2010 22:10                    0.07639
    34215          3/1/2010 22:10     3/2/2010 4:30     321B          3/2/2010     3/3/2010     3/2/2010 4:30                    3/2/2010 0:00                    0.18750
    34215          3/1/2010 22:10     3/2/2010 4:30     321B          3/3/2010     3/4/2010     3/2/2010 4:30                    3/3/2010 0:00                    0.00000
    34215          3/1/2010 22:10     3/2/2010 4:30     321B          3/4/2010     3/5/2010     3/2/2010 4:30                    3/4/2010 0:00                    0.00000
    34215          3/1/2010 22:10     3/2/2010 4:30     321B          3/5/2010     3/6/2010     3/2/2010 4:30                    3/5/2010 0:00                    0.00000
    24789          3/2/2010 13:00     3/5/2010 2:30     123A          3/1/2010     3/2/2010     3/2/2010 0:00                    3/2/2010 13:00                    0.00000
    24789          3/2/2010 13:00     3/5/2010 2:30     123A          3/2/2010     3/3/2010     3/3/2010 0:00                    3/2/2010 13:00                    0.45833
    24789          3/2/2010 13:00     3/5/2010 2:30     123A          3/3/2010     3/4/2010     3/4/2010 0:00                    3/3/2010 0:00                    1.00000
    24789          3/2/2010 13:00     3/5/2010 2:30     123A          3/4/2010     3/5/2010     3/5/2010 0:00                    3/4/2010 0:00                    1.00000
    24789          3/2/2010 13:00     3/5/2010 2:30     123A          3/5/2010     3/6/2010     3/5/2010 2:30                    3/5/2010 0:00                    0.10417
    31542          3/2/2010 21:30     3/4/2010 10:30     321B          3/1/2010     3/2/2010     3/2/2010 0:00                    3/2/2010 21:30                    0.00000
    31542          3/2/2010 21:30     3/4/2010 10:30     321B          3/2/2010     3/3/2010     3/3/2010 0:00                    3/2/2010 21:30                    0.10417
    31542          3/2/2010 21:30     3/4/2010 10:30     321B          3/3/2010     3/4/2010     3/4/2010 0:00                    3/3/2010 0:00                    1.00000
    31542          3/2/2010 21:30     3/4/2010 10:30     321B          3/4/2010     3/5/2010     3/4/2010 10:30                    3/4/2010 0:00                    0.43750
    31542          3/2/2010 21:30     3/4/2010 10:30     321B          3/5/2010     3/6/2010     3/4/2010 10:30                    3/5/2010 0:00                    0.00000
    (Then, the query sums up the last column in the "table" above, grouped by a_date and workstation).

  • Problem in  date & time

    Problem 1:
    i'm using date in midlet, but it does not give me the correct System time.
    Problem 2:
    the date field returns the date & time in milliseconds. how can i get the date in format 06 sep 2002.

    Hi,
    You can use the method System.currentTimeMillis(), that returns a long value that is your system's current time.
    DateField dateField = new DateField("Date", DateField.DATE_TIME);
    dateField.setDate(new Date(System.currentTimeMillis()));
    To get the day, month and year you can use the Calendar class.
    Calendar calend = Calendar.getInstance();
    calend.setTime(new Date(long yourdatemillis));
    So you can get the correct parameters by calling
    calend.DAY_OF_MONTH, calend.MONTH and calend.YEAR and appending it to a String and displaying it. But the day of month and month, i think, returns the correct value decreased of 1.
    Ricardo

  • Problem with date + time

    Hi,
    I have a long time problem.
    I want to insert to my table the result of JXDatepicker + JSpinner (time HH:ss).
    It is work until I am calulate todays link in millisecound.
    please run my exampele to see my problem and I'll be happy if u can help me (cell 0,0).
    if you click in every date exept todays link, u get good result format (yyyy-MM-dd HH:ss:00)
    import java.awt.BorderLayout;import java.awt.event.ActionEvent;import java.awt.event.ActionListener;import java.util.Date;import javax.swing.JButton;import javax.swing.JFormattedTextField;import javax.swing.JFrame;import javax.swing.JPanel;import javax.swing.JScrollPane;import javax.swing.table.DefaultTableModel;import org.jdesktop.swingx.JXTable;public class MyTable extends JFrame implements ActionListener {     private JXTable table;     private QM6JXDatePicker date;     private QM6JSpinner spinner;     private JFormattedTextField TxtfPriority;     public MyTable() {          String[] columnNames = { "Date", "String", "Integer" };          Object[][] data = { { new Date(), "AAA", 11 }, { new Date(), "B", 22 },                    { new Date(), "CCCCCC", 3 }, { new Date(), "D", 4 } };          DefaultTableModel model = new DefaultTableModel(data, columnNames);          table = new JXTable(model);          table.setPreferredScrollableViewportSize(table.getPreferredSize());          JScrollPane scrollPane = new JScrollPane(table);          getContentPane().add(scrollPane);          JButton button = new JButton("Update");          button.addActionListener(this);          getContentPane().add(button, BorderLayout.SOUTH);          getContentPane().add(getPanel(), BorderLayout.NORTH);     }     public JPanel getPanel() {          JPanel panel = new JPanel();          date = new QM6JXDatePicker();          spinner = new QM6JSpinner();          panel.add(date);          panel.add(spinner);          return panel;     }     public void actionPerformed(ActionEvent arg0) {          java.sql.Timestamp newDate = new java.sql.Timestamp(date.getDate()                    .getTime());          long miliSecDate = newDate.getTime();          String s = spinner.getTime();          String[] timeStr = s.split(":");          long miliSecTimeH = Long.parseLong(timeStr[0].trim());          long miliSecTimeS = Long.parseLong(timeStr[1].trim());          long miliSecTime = ((miliSecTimeH * 60 * 60) + (miliSecTimeS * 60)) * 1000;          newDate.setTime(miliSecTime + miliSecDate);          table.setValueAt(newDate, 0, 0);     }     public static void main(String[] args) {          MyTable frame = new MyTable();          frame.setDefaultCloseOperation(EXIT_ON_CLOSE);          frame.pack();          frame.setVisible(true);     }}
    import java.awt.BorderLayout;
    import java.awt.Color;
    import java.awt.event.ActionEvent;
    import java.awt.event.ActionListener;
    import java.text.DateFormat;
    import java.text.SimpleDateFormat;
    import java.util.Calendar;
    import java.util.Date;
    import javax.swing.JPanel;
    import org.jdesktop.swingx.JXDatePicker;
    import org.jdesktop.swingx.JXHyperlink;
    import org.jdesktop.swingx.calendar.JXMonthView;
    public class QM6JXDatePicker extends JXDatePicker {
         private String[] dateStr = null;
         private DateFormat df;
         private SimpleDateFormat df2;
         private JPanel newLinkPanel;
         private JXMonthView calend;
         public QM6JXDatePicker() {
              df = DateFormat.getDateInstance(DateFormat.LONG);
              df2 = new SimpleDateFormat("dd/MM/yyyy");
              dateStr = new String[] { "dd/MM/yyyy" };
              getJXMonthView();
              LinkPanel();
              setFormats(dateStr);
              setMonthView(calend);
              setLinkPanel(newLinkPanel);
         private void LinkPanel() {
              newLinkPanel = new JPanel(new BorderLayout());
              JXHyperlink todayLink = new JXHyperlink();
              todayLink.addActionListener(new ActionListener() {
                   public void actionPerformed(ActionEvent e) {
                        getEditor().setText(df2.format((new Date())));
                        setDate(new Date());
                        getMonthView().getParent().setVisible(false);
              todayLink.setText("Today: " + df.format(new Date()));
              newLinkPanel.add(todayLink, BorderLayout.CENTER);
         private void getJXMonthView() {
              calend = new JXMonthView();
              calend.setTraversable(true);
              calend.setDayForeground(7, Color.RED);
              calend.setDaysOfTheWeekForeground(Color.BLUE);
              calend.setSelectedBackground(Color.YELLOW);
              calend.setFirstDayOfWeek(Calendar.SUNDAY);
         public JXMonthView getCalend() {
              return calend;
         public void setCalend(JXMonthView calend) {
              this.calend = calend;
    import java.util.Calendar;
    import java.util.Date;
    import javax.swing.JSpinner;
    import javax.swing.SpinnerDateModel;
    public class QM6JSpinner extends JSpinner{
         private JSpinner.DateEditor dateEditor;
         public QM6JSpinner() {
              setModel(new SpinnerDateModel(new Date(),
                        null, null, Calendar.MINUTE));
              dateEditor = new DateEditor(this, "HH:mm");
              setEditor(dateEditor);
         public String getTime() {
              return dateEditor.getTextField().getText();
    }Tanks alot!
    Yael

    The main class here...
    import java.awt.BorderLayout;
    import java.awt.event.ActionEvent;
    import java.awt.event.ActionListener;
    import java.util.Date;
    import javax.swing.JButton;
    import javax.swing.JFormattedTextField;
    import javax.swing.JFrame;
    import javax.swing.JPanel;
    import javax.swing.JScrollPane;
    import javax.swing.table.DefaultTableModel;
    import org.jdesktop.swingx.JXTable;
    public class MyTable extends JFrame implements ActionListener {
         private JXTable table;
         private QM6JXDatePicker date;
         private QM6JSpinner spinner;
         private JFormattedTextField TxtfPriority;
         public MyTable() {
              String[] columnNames = { "Date", "String", "Integer" };
              Object[][] data = { { new Date(), "AAA", 11 }, { new Date(), "B", 22 },
                        { new Date(), "CCCCCC", 3 }, { new Date(), "D", 4 } };
              DefaultTableModel model = new DefaultTableModel(data, columnNames);
              table = new JXTable(model);
              table.setPreferredScrollableViewportSize(table.getPreferredSize());
              JScrollPane scrollPane = new JScrollPane(table);
              getContentPane().add(scrollPane);
              JButton button = new JButton("Update");
              button.addActionListener(this);
              getContentPane().add(button, BorderLayout.SOUTH);
              getContentPane().add(getPanel(), BorderLayout.NORTH);
         public JPanel getPanel() {
              JPanel panel = new JPanel();
              date = new QM6JXDatePicker();
              spinner = new QM6JSpinner();
              panel.add(date);
              panel.add(spinner);
              return panel;
         public void actionPerformed(ActionEvent arg0) {
              java.sql.Timestamp newDate = new java.sql.Timestamp(date.getDate()
                        .getTime());
              long miliSecDate = newDate.getTime();
              String s = spinner.getTime();
              String[] timeStr = s.split(":");
              long miliSecTimeH = Long.parseLong(timeStr[0].trim());
              long miliSecTimeS = Long.parseLong(timeStr[1].trim());
              long miliSecTime = ((miliSecTimeH * 60 * 60) + (miliSecTimeS * 60)) * 1000;
              newDate.setTime(miliSecTime + miliSecDate);
              table.setValueAt(newDate, 0, 0);
         public static void main(String[] args) {
              MyTable frame = new MyTable();
              frame.setDefaultCloseOperation(EXIT_ON_CLOSE);
              frame.pack();
              frame.setVisible(true);
    }

  • Problem with Date & Time Auto Update

    Hi everyone,
    I have been experiencing a date & time issue with my MacBook Air. (I am running 10.5.5 with all the latest software updates except for iTunes 8). Here's what's going on:
    Under the Date & Time preferences, whenever I try to check the box for "Set date & time automatically", the date and time do not update. I thought Norton might be the culprit in this case, but I have thoroughly uninstalled it, and this problem still persists. (I am actually borrowing this laptop for work, so I don't know if someone else possibly did something weird to it before I started using it. As far as I can remember, I've always had this problem -- the automatic setting has never worked.)
    I am connected to the internet when I do this, and I already have my time zone selected. Am I missing something obvious here?
    I apologize if this issue has been brought up before, but I did a lot of searching and couldn't find anything. Any suggestions would be greatly appreciated!!
    Thank you.

    whenever I try to check the box for "Set date & time automatically"
    You check it and the time does not update, or you try to check it and it doesn't show a little tick mark?
    Try it with Console.app open and see does it report any errors. Try changing the time server.
    AK

  • Problem with Date / Time Title - Showing Inacurate Information

    I use iMovie to make videos for my job. The videos need to have an accurate running time and date displayed on them. I use the "Date/Time" Title option and the running time and date appear on the video. BUT- there is a problem. The time is wrong.
    When I import a video clip (from my Panasonic HDC-TM80) into iMovie, I can see the "time and date created" as well as the "length" of the video clip. The time and date created shows the time and date of when the clip ENDS. When I overlay the "Date/Time" Title, it starts the time (at the beginning of the clip) from the created time (which is actually the end).
    Example:
    Clip Created (end of clip): 3/23/11 10:30:00am
    Length of clip: 12 min. 35 sec.
    The actual Date/Time Title should show 10:17:25am at the beginning and runs through 10:30:00am (the end).
    But instead it shows 10:30:00am at the beginning and runs through 10:42:35am. This obviously results in a 12 min. 35 sec. inaccuracy.
    Is this a problem with the software? Is there a way to contact someone to alert them of this problem? Or am I missing something simple?
    Thanks in advance for anyone's help.
    -as a quick fix, I adjusted the time and date on the video clips so that it would show the correct info, but I'm usually working with several clips at a time and it is laborious to change each one.

    I don't have an answer but was wondering how you like the TM80? Except for the date/time issue, is it compatible with iMovie'11?
    Thanks!

  • Date time field problem

    Hello there
    This maybe a simple problem but on the Date time field object i have input a display pattern and put the error message in. When I preview the PDF and populate the object with random text the pop up box will display my error message.
    What it does not do is clear the text I have input so the date can be re-entered correctly, which is what I was expecting. Therefore the user can continue on without addressing the date correctly.
    Can anyone advise what I should do to get this to work?
    Thanks
    Darren

    Hi
    The first time I thinkanyone has answered their own post. So for the benefit of anyone else I added the folowing script to the exit event
    of the date field object
    if (page.subform.dateobject.rawValue == page.subform.dateobject.formattedValue) {
    xfa.host.resetData("xfa.form.Formtitle.Page.subform.datefieldobject")
    Not sure why it works but just played around with it.

  • I have got problem with "Date & Time"

    I have bought a new Macbook Air 13"
    I have chosen "set date & time auto..."
    However, it shows in up right corner wrong date. Also all mail, reminders and etc work with wrong date.
    Please, tell me what to do with this problem.
    Sincerelly,
    Mark

    Incorrect date or time displayed in various applications

  • Problem with Date/Time field in Adobe LiveCycle

    I am trying to create a form that has a check-in and check-out dates. I want the user to enter those dates and then have the form automatically compute how many nights the user intends on staying.
    I have two fields, CHECKIN and CHECKOUT, set up as text fields. My third field, NIGHTS, has the following script to do the calculation:
    var strStart = CHECKIN.rawValue
    var strEnd = CHECKOUT.rawValue
    if(strStart.length && strEnd.length)
    var dateStart = util.scand("mmm d, yyyy",strStart);
    var dateEnd = util.scand("mmm d, yyyy",strEnd);
    var diff = dateEnd.getTime() - dateStart.getTime();
    var oneDay = 24 * 60 * 60 * 1000;
    var days = Math.floor(diff/oneDay);
    this.rawValue = days;
    else
    this.rawValue = 0;
    NOW...this is fine if the user inputs a four-digit year. If not, it's trouble. SO, what I want to do is change the CHECKIN and CHECKOUT fields to the date/time field so they select the date off the pop-up calendar.
    When I make the changes, I can't get the script to work for the NIGHTS field.
    CAN ANYONE HELP THIS NEWBIE?

    Make sure the format of the date strings provided by the calendar is what you are expecting. Or use the "formattedValue" for the input strings.

Maybe you are looking for