Date and Timezone problem...

Hello,
Please, can sombody explain me the following program
          long l = System.currentTimeMillis();
          for (int i = 0; i < 25; i++ ){
               l = l - 86400000;
               System.out.println(i+":"+new Date(l));
Output:
0:Tue Apr 23 09:26:15 CEST 2002
1:Mon Apr 22 09:26:15 CEST 2002
2:Sun Apr 21 09:26:15 CEST 2002
3:Sat Apr 20 09:26:15 CEST 2002
4:Fri Apr 19 09:26:15 CEST 2002
5:Thu Apr 18 09:26:15 CEST 2002
6:Wed Apr 17 09:26:15 CEST 2002
7:Tue Apr 16 09:26:15 CEST 2002
8:Mon Apr 15 09:26:15 CEST 2002
9:Sun Apr 14 09:26:15 CEST 2002
10:Sat Apr 13 09:26:15 CEST 2002
11:Fri Apr 12 09:26:15 CEST 2002
12:Thu Apr 11 09:26:15 CEST 2002
13:Wed Apr 10 09:26:15 CEST 2002
14:Tue Apr 09 09:26:15 CEST 2002
15:Mon Apr 08 09:26:15 CEST 2002
16:Sun Apr 07 09:26:15 CEST 2002
17:Sat Apr 06 09:26:15 CEST 2002
18:Fri Apr 05 09:26:15 CEST 2002
19:Thu Apr 04 09:26:15 CEST 2002
20:Wed Apr 03 09:26:15 CEST 2002
21:Tue Apr 02 09:26:15 CEST 2002
22:Mon Apr 01 09:26:15 CEST 2002
23:Sun Mar 31 09:26:15 CEST 2002
24:Sat Mar 30 08:26:15 CET 2002
Why does does the Timezone change?
CEST => CET????
Any Ideas
Greeting & Thanks
Peter

CEST means Central European Summer Time.
CET means Central European Time.
Is has something to do with the summer time.

Similar Messages

  • UDF having date and timezone field in OIM 11gR2

    Hi Experts,
    How to create UDF having date and time filed in OIM11gR2?
    Thanks,
    Amit
    Edited by: 955130 on Dec 13, 2012 12:18 AM

    Basically the problem set is, my client wants to enter the term date as date and time, but by default the term date comes with calendar popup that does not support time entry also from user form.
    Yes, it is correct that we can use date as well as string, and the solution proposed is like we add 3 drop down along with the term date,
    first drp down contains hours HH, second MM and third location (For maintaining the office location)
    I want an advise on below things:
    1. Does OIM supports globalisation and localization concept. meaning the date time is maintined as location specific or do i need to save location somewhere and create a lookup field where all the locaitons and there difference of timezones are kept?
    2. Can i have a calendar replaceed by date time calender so that i can get rid of drop downs?
    3. If not, which is the best way of updating my term date with time also, will event handler work here?
    thanks all.

  • Null Date and Time Problem

    I created my entity classes from a database by using netbeans 6.0 and I'm using H2 as a database. I've the following table in my database.
    CREATE CACHED TABLE OPEN_TABLE ( ID INTEGER GENERATED BY DEFAULT AS IDENTITY(START WITH 0) NOT NULL PRIMARY KEY, TABLE_ID INTEGER, WAITER_ID INTEGER, OPEN_HOUR TIME DEFAULT CURRENT_TIME, OPEN_DATE DATE DEFAULT CURRENT_DATE );
    and here is the entity class netbeans created for me.
    import java.io.Serializable; import java.util.Date; import javax.persistence.Column; import javax.persistence.Entity; import javax.persistence.Id; import javax.persistence.NamedQueries; import javax.persistence.NamedQuery; import javax.persistence.Table; import javax.persistence.Temporal; import javax.persistence.TemporalType; /** * * @author Yupp */ @Entity @Table(name = "OPEN_TABLE") @NamedQueries({@NamedQuery(name = "OpenTable.findById", query = "SELECT o FROM OpenTable o WHERE o.id = :id"), @NamedQuery(name = "OpenTable.findByTableId", query = "SELECT o FROM OpenTable o WHERE o.tableId = :tableId"), @NamedQuery(name = "OpenTable.findByWaiterId", query = "SELECT o FROM OpenTable o WHERE o.waiterId = :waiterId"), @NamedQuery(name = "OpenTable.findByOpenHour", query = "SELECT o FROM OpenTable o WHERE o.openHour = :openHour"), @NamedQuery(name = "OpenTable.findByOpenDate", query = "SELECT o FROM OpenTable o WHERE o.openDate = :openDate")}) public class OpenTable implements Serializable {     private static final long serialVersionUID = 1L;     @Id     @Column(name = "ID", nullable = false)     private Integer id;     @Column(name = "TABLE_ID")     private Integer tableId;     @Column(name = "WAITER_ID")     private Integer waiterId;     @Column(name = "OPEN_HOUR")     @Temporal(TemporalType.TIME)     private Date openHour;     @Column(name = "OPEN_DATE")     @Temporal(TemporalType.DATE)     private Date openDate;     public OpenTable() {     }     public OpenTable(Integer id) {         this.id = id;     }     public OpenTable(Integer id, Date openHour, Date openDate) {         this.id = id;         this.openHour = openHour;         this.openDate = openDate;     }     public Integer getId() {         return id;     }     public void setId(Integer id) {         this.id = id;     }     public Integer getTableId() {         return tableId;     }     public void setTableId(Integer tableId) {         this.tableId = tableId;     }     public Integer getWaiterId() {         return waiterId;     }     public void setWaiterId(Integer waiterId) {         this.waiterId = waiterId;     }     public Date getOpenHour() {         return openHour;     }     public void setOpenHour(Date openHour) {         this.openHour = openHour;     }     public Date getOpenDate() {         return openDate;     }     public void setOpenDate(Date openDate) {         this.openDate = openDate;     }     @Override     public int hashCode() {         int hash = 0;         hash += (id != null ? id.hashCode() : 0);         return hash;     }     @Override     public boolean equals(Object object) {         // TODO: Warning - this method won't work in the case the id fields are not set         if (!(object instanceof OpenTable)) {             return false;         }         OpenTable other = (OpenTable) object;         if ((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id))) {             return false;         }         return true;     }     @Override     public String toString() {         return "OpenTable[id=" + id + "]";     } }
    The problem is when I try to insert a new OpenTable to the database, Open_Date and Open_Hour columns stay as null. I want them to get the automatic CURRENT_DATE and CURRENT_TIME values. I can't see where the problem is because I used CURRENT_DATE and CURRENT_TIME words when I created the table. I don't have any problems when I use standart SQL statements to insert a new row. I just use INSERT INTO OPEN_TABLE(TABLE_ID, WAITER_ID) VALUES(2,3) and get current date and hour values automatically but JPA doesn't do that for me. What should I do to solve the problem?

    Those database defaults are only applied when you use an INSERT statement that specifies a list of columns excluding the ones with defaults. Presumably your persistence code always sets all columns when it does an INSERT, so the defaults won't apply. You'll have to find the way to set the defaults in the persistence layer, not in the database.

  • Calendar, date and timezone

    Hi everybody,
    I'm using the CLLocation class and I cannot find any documentation on it in google. DO you know where it is ?
    I know how to get the timestamp for the date, but here are some questions about it :
    -Does this date include the timezone value so I know from my position what is the timezone ?
    -How to convert the timestamp (NSDate instance I think) into a NSCalendar with which I could get the timezone information ?
    Thank you

    Because the Timezone isn't part of the timestamp for a date.
    This is one thing that Java got right. Think of it this way. There is no such thing as just 9.am. It's 9am in a specific place (timezone) on the Earth. Because at the same time it's 9am in one timezone it's 1pm in another timezone and 11:30 am in another timezone. etc. But all these representations of the time actually hold the exact same long millisecond value.
    So you never hold the timezone as part of the date. Timezones are only used for display or for parsing a value in.

  • DATE and TIMESTAMP problem - fixable with 11.1 JDBC Driver?

    I'm adding some queries to an older part of our code base and while reading through the documentation for one of the classes I found that we weren't using our normal Hibernate queries because we needed to ensure that we weren't sending Timestamps to Oracle. Apparently the Timestamp would be converted to a Date because the column in the database was of type DATE. This was causing problems because the DATE column's index was being ignored and the table contains millions of records.
    The Oracle FAQ seems to indicate that this has been fixed in the 11.1 JDBC drivers. I know that I can use 11.1 JDBC drivers with a 10.2.0 database, but will it use the new 11.1 mappings for DATE and TIMESTAMP or the old 10.2.0 mappings? Oracle FAQ page: http://www.oracle.com/technetwork/database/enterprise-edition/jdbc-faq-090281.html#08_01

    Oracle FAQ page: http://www.oracle.com/technetwork/database/enterprise-edition/jdbc-faq-090281.html#08_01
    Well obviously that was really stupid.
    I'm adding some queries to an older part of our code base and while reading through the documentation for one of the classes I found that we weren't using our normal Hibernate queries because we needed to ensure that we weren't sending Timestamps to Oracle. Apparently the Timestamp would be converted to a Date because the column in the database was of type DATE. This was causing problems because the DATE column's index was being ignored and the table contains millions of records.
    Not sure I follow that logic.
    If the value was going into the database then it would update the index.
    From that only one of the following could be true.
    1. It wasn't going into the database.
    2. It was being truncated to a date.
    The Oracle FAQ seems to indicate that this has been fixed in the 11.1 JDBC drivers. I know that I can use 11.1 JDBC drivers with a 10.2.0 database, but will it use the new 11.1 mappings for DATE and TIMESTAMP or the old 10.2.0 mappings? I would agree with your interpretation of the FAQ.
    And I would then follow it up by testing both with the old driver and the new.

  • Time, date and settings problems with boot camp

    I have recently installed Windows XP using boot camp on my macbook, and everything seemed to be working fine for a while. However, after a couple of weeks, i am now getting date and time errors every time i shut down Windows and boot back into Mac OS. Upon restart the date always resets it self to December 2000, and this causes multiple programs to stop working. Also, airport forgets my wireless settings and no longer connects to my base station until i re-enter the passwords, so the date wont correct itself using the internet. The only way i have been able to set the correct time and date is to either set it manually, or to use the ethernet cable as it requires no passwords, which is inconvenient as my base station is in a awkward place.
    After resetting the time, date and internet settings, my macbook works perfectly again until the next time i use boot camp. I have also had exactly the same problem with another macbook i have, and cannot figure out how to stop this from happening.

    FAT32 will accessible from both Windows and OS X
    If you don't want to reformat your ext drive you need something like http://www.paragon-software.com/home/hfs-windows/ or http://www.mediafour.com/products/macdrive/

  • Date and time problems

    On my older imacG5 running tiger I am able to display the clock as a floating transparent icon on the desktop which shows the date and time,
    on my newer intel imac and macbook pro running leopard I cannot do this, in fact there's two things that I can't do with leopard;
    1. I can't get the date displayed in the menu bar even when clicking show date and time in menu bar (only shows day of the week and time, but not the date)
    2. I can't get any clock to be displayed on the desktop? it's either in the menu bar or not at all.
    am I missing something or has Apple taken this feature away?
    (surely this isn't progress??)
    What's different in the two OS's is this:
    In Tiger date and time System Prefs there is a View In "Window" or "Menu Bar" option
    (selecting Window put s the clock on the desktop)
    as well as a sliding transperancy button which makes the clock see thro
    neither of these options are available in Leopard, so!!
    Is there a way to import the clock from the older machine/OSX?
    cheers

    Forgot to add when the time changes on its own, the time zone also changes to New York. I originaly set it to Montreal.

  • Problem with date and timezone

    Hello,
    I am encountering a problem with the command new java.util.date() on a hpux 11 machine.
    The "date" from command line returns:
    Tue Oct 26 18:02:02 MEST 2004
    And the date from java returns:
    Tue Oct 26 17:02:02 GMT+01:00 2004
    It is as if the JVM was running on another timezone than the machine. The only change we made is an upgrade from java 1.2.2.04 to 1.2.2.17. Our old java program running since 2000 hasn't changed nor the others environment files.
    Does anyone has an explaination? Javadoc for jav.util.date does not speaks of timezone.
    Thanks in advance,
    Valere

    I have tried, it is the same pb with java 1.4.
    How to set the default timezone for a JVM?
    Concerning the patch, we have several others worksations running well with 1.2.2.04 (except a small display bug that i wanted to correct by upgrading the JVM). To my knowledge, this patch is not installed on any of them.
    Another way to investigate, it seems that the java version installed on the others stations refers to java 3D. What is it? It has a different architecture than standard jre, but java -version seems exactly the same (except the version number itself).
    Mayday, mayday!

  • SimpleDateFormat and TimeZone problem

    Hi all, I know there have been a lot of questions
    concerning this topic, but I've looked over a lot
    of messages and I think I've used all ideas provided,
    yet still I can't fix my problem.
    My problem concerns parsing a date from a HTTP
    packet. I use the following code:
    SimpleDateFormat sdf = new SimpleDateFormat("EEE, dd MMM yyyy hh:mm:ss zzz");
    sdf.setTimeZone(TimeZone.getDefault());
    Date date = sdf.parse(packet.substring(exp_pos+9, endline));Most of the time this code works perfectly, however
    from time to time the parse result is 12 hours of.
    Instead of 14h the result is 2h. HTTP dates use a
    24 hour time.
    I'm using the JVM by Blackdown, version 1.3.1 on
    Debian Linux 2.2.18. The timezone is configured
    correctly in my os. I'm in GMT+1.
    I'm not sure if this is a bug or if I have done something
    wrong.
    Any help would be greatly appreciated.
    Peter

    Looks to me that your time format with lower-case "hh" tells it to use the 12-hour, not 24-hour format, and you're not including the am/pm indicator. So it's doing just what you're telling it to do. If you want 24-hour format, use "HH" instead of "hh".

  • Quality and WorkForce Management ACD data and some problems

    I installed the Quality / Adv Quality Mgt. and than i installed workforce management services. I have access panels each service no problem. But, I constantly getting the following mail from WFO and I do not know how to solve
    WFM2001
    Message:
    The Capture Service is failing to capture ACD data.
    Action: Contact technical support.
    Other problem; I can't see anything about my agents, teams or etc. when i open WFO web management page or Quality Manager Administration.
    For example on WFO web management page, left pane, Agents menu, i can't see my CXX agents.
    Last one, i need to WFO and Qualit Management Recording using documentation (how to use both programs ?)
    Thx....

    Hi
    Documentation is here : http://www.cisco.com/en/US/products/ps8293/tsd_products_support_series_home.html
    It would appear you haven't set up the SQL connection as directed in chapter 3 of the install guide.
    Aaron

  • Enter Date and Time Problems

    When the entering the date or time in application like contacts birthday  etc...  the date button icons are all on top of each other and pressing the icon only brings up the year field.  The time is the same issue, all time button icons are on top of each other and only the am/pm field can be entered.   Got any suggestions?
    Post relates to: Pixi p120eww (Sprint)

    Hello K_Johanson and welcome to the Palm forums.
    I'm running webOS 1.4.5 on my Sprint Pre and I'm not seeing this issue when I try to enter a date for a birthday in Contacts.
    Have you tried restarting your phone?  Do you have the problem if you create a new Contacts record?
    Alan G

  • Converting dates and timezones

    I have a third-party application that is feeding me data. I will get a particular line and it will include a message time in GMT and the local timezone offset as a number (-5, -6, etc.) rather than as a Timezone. I need to get the actual local time of the message so I can process the row. I looked at the NEW_TIME() built-in function, but it doesn't look like it can handle the offset by itself - it wants the original and new timezone in text. The tricky part is that this is a vehicle tracking application, so vehicles will be in various timezones. Add in the complications of dealing with daylight savings and this quickly becomes a chore.
    Has anyone got a quick little function (an ADD_HOURS function similar to an ADD_MONTHS would be perfect) that can convert the date I am given (accounting for changes in Daylight Savings)? The best would be a simple function that just takes a date value and an offset in hours and returns the new/converted date. Thanks in advance.

    Thanks for the link. After doing some digging and experimenting, I was able to use the following to get what I need:
    DECLARE
      tmp_dttm      DATE;
      tmp_tz        VARCHAR2(3);
      v_dttm        DATE;
    BEGIN
      tmp_dttm   :=  :NEW.LOCATION_DATE;
      tmp_tz     :=  :NEW.LOCATION_TIMEZONE;
      --Convert the time to local
      v_sql  := 'select to_date('''|| to_char(tmp_dttm,'MM/DD/YYYY HH24:MI:SS')||''',''MM/DD/YYYY HH24:MI:SS'')'||'+INTERVAL '''|| tmp_tz ||''' HOUR from dual';
      dbms_output.put_line ('SQL String: ' || v_sql);
      execute immediate v_sql into v_dttm ;
    ...The INTERVAL function is what I was looking for.

  • CMP dates and timezones

    Is there anyway to have a cmp bean with a java.util.Date or java.sql.Timestamp attribute to insert that date into the db (oracle in this case) in GMT, regardless of it's timezone?
    Can this be done through a descriptor?

    The clients are PCs that have TV recorder cards. I have an existing system that has a simple MySQL table, a PHP web front end and Java JDBC clients that poll the DB directly and do the recordings.
    I'm not quite sure what you mean by using a timer. I haven't fully designed the client server protocol/conversation for the EJB system, but I expect something like.
    ClientN -> Server : "Hi I'm ready for work"
    Server -> Client : "Grand"
    [Every 10 seconds of so]
    ClientN -> Server : "Got any work for me?"
    Server->ClientN : "Nope"
    [Until]
    Server->ClientN : "Yes, do this!"
    ClientN->Server : "Certainly! I'll get right to that"
    [Every 10 seconds of so]
    ClientN->Server : "I'm doing this thing you asked, okay?"
    Server->ClientN : "Yep, keep going."
    [OR]
    ClientN->Server : "Look, I've messed up somehow, I've given up."
    Server->ClientN : "Fine, I'll get someone else who can do it."
    [OR]
    ClientN->Server : "I'm doing this thing you asked, okay?"
    Server->ClientN : "No, stop right there!"
    This allows 'tasks' aka recordings to be given to pooled devices and for recordings to switch device mid recording even.
    All I need is a method query to query between date ranges and determine which programmes should be running and then figure out "Programme->Ready Device" priorities.
    I did consider an event based system. Where the clients listen on a UDP port for commands from the server, but it didn't seem to fit with the request/response/session nature of EJB conversational flow.
    I'm still very new to EJBs and J2EE in general, maybe getting in too deep too soon with this project.
    Paul

  • PI 7.3 - AEX "unable to read configuration data" and login problems

    Hello Friends,
    after installation of AEX, i'm facing some problems.
    1.I'm not able to login with any user, i created during installation wizard. So i cannot check any user in NWA -> User Administration.
    2.Once more, while opening http://<host>:<port>/rep or http://<host>:<port>/dir, i get the following error message.
    Can somebody help me?
    I think, there is a problem with the users, which have been created during installation. How can i check this? Is there any chance?
    Second, if i'm able to login, i have to import the exchange profile again. This should solve the problem. Or is this wrong?
    PI (http://<host>:<port>/dir/start/index.jsp). Below is the part of the error message that is showing up. Appreciate your suggestions:
    Exception class: com.sap.aii.utilxi.prop.api.PropertiesException$InitFailed
    Message
    Unable to read configuration data (ExchangeProfile/aii.properties)
    Stacktrace
    Thrown:
    com.sap.aii.utilxi.prop.api.PropertiesException$InitFailed: Unable to read configuration data (ExchangeProfile/aii.properties)
    at com.sap.aii.utilxi.prop.api.PropertySourceFactory.initServerMode(PropertySourceFactory.java:220)
    at com.sap.aii.utilxi.prop.api.AIIProperties.initServerMode(AIIProperties.java:518)
    at com.sap.aii.ib.server.applcomp.StartupServerProperties.initPropertiesForServer(StartupServerProperties.java:97)
    at com.sap.aii.ibdir.server.applcomp.StartupCodeEntry.startup(StartupCodeEntry.java:151)
    at com.sap.aii.ib.core.applcomp.IStartupCodeEntry.startupIfNotAlreadyDone(IStartupCodeEntry.java:43)
    at com.sap.aii.ib.core.applcomp.ExplicitApplicationComponentImpl.startup(ExplicitApplicationComponentImpl.java:116)
    at com.sap.aii.ib.core.applcomp.ExplicitApplicationComponents.startup(ExplicitApplicationComponents.java:438)
    at com.sap.aii.ib.core.applcomp.ApplicationComponent.startup(ApplicationComponent.java:203)
    Please let me know if I am not clear.
    Edited by: Clarence on Feb 6, 2012 3:28 PM
    Edited by: Clarence on Feb 6, 2012 3:28 PM

    hi,
    >>>>Second, if i'm able to login, i have to import the exchange profile again. This should solve the problem. Or is this wrong?
    if you have java stack only there is no exchange profile anymore...
    https://weblogs.sdn.sap.com/pub/wlg/28334
    Regards,
    Michal Krawczyk

  • Cellular Data and Wifi Problem

    Hi Guys.  I wonder if you can advise?
    I have an iPhone 4S on a monthly contract with an unlimited cellular data plan.  The phone is set to Settings-General-Cellular-On= Cellular Data On, Enable 3G On, Data Roaming On.  Also, Settings-Wi-Fi On-Ask To Join Networks.
    My phone finds and connects to my home network when I come back to the house but when I'm out it will not connect to any other Wifi network.  I have tried all of the resets and stuff but no good.  When I try to connect to a new network the Login page comes up but no details and then the remote server times out.  If I go to Safari and try to access a web page I just get the pop up asking me to join a Wifi Network and when I do an error popup shows saying that the network is unavailable.
    Messing around with the phone I have found that if I turn off Cellular Data (web, 3G, email push using wifi only) I can access other networks but, of course, have no 3G cellular data service unless I am in a wifi hotspot.
    Is there a way to make the phone switch to cellular data on 3G when out of range of wifi and back again?
    Anyway, if anyone can advise it would be appreciated.
    Regards
    Paul

    UPDATE:
    Turning off Cellular Data at a local wifi spot (not used before) didn't work this time.  However, turning off Cellular and going into Settings-General-Reset-Reset Network Settings then acquiring the wifi network did. I could then turn Cellular Data back on and use the wifi spot.
    Will try at another hotspot soon to see if the phone will automatically ask to join the network and allow me to do so without doing the above, as I don't want to be re-inputting other network passwords etc over and over again.

Maybe you are looking for