When biweekly parses the value of a date-based property, it attempts to determine the timezone that the date is in if a TZID parameter is defined. If it doesn't recognize the timezone (using the "java.util.TimeZone.getTimeZone(String)" method), then it just parses the date according to the JVM's default timezone.
So, with the third example, knowing that it is parsed under the default timezone, you would have to manually convert the "java.util.Date" object to the timezone of your choosing.
Does that help? Is there some feature that you'd like to see added?
-Mike
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
In fact, the timezone in which I want to parse my iCal depends on the user who reads it, and must be managed dynamically.
So, I have to change timezones on the fly.
I quickly wrote this method :
I'm confused about why you are setting the timezone ID. Calling "setTimezoneId()" has no effect on the property object's date value. The only time the timezone ID is used is when the iCal is written. When an iCal is written, it will format the date according to the property's timezone ID parameter.
Mike
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hm, you're right, I'm sorry, I used to think it would set the date object TimeZone... But, the object is a Date and there is no timezones on Dates objects... really confused !
I think I will take some more time to think about this, hoping I would'nt have to bother you again...
Thanks for your patience ! :D
And good luck for TimeZones!
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Yes, Date objects don't have timezones associated with them. Their internal value is UTC time. You can format a Date object in a certain timezone by calling "DateFormat.setTimeZone()":
Hello,
I'm really sorry, I hope you will forgive me, I'm back to speak about... timezones !
First of all, thanks for your documentation "Working with Timezones", your explanations are very helpful !
But there is something else I would like to be able to do :
to parse with a specific timezone, and not with the JVM's one..
Is there any way to do that without changing all events, one by one, and field by field ?
Thanks for your help,
Perrine
Hi Perrine!
Ugh...timezones... ;)
When biweekly parses the value of a date-based property, it attempts to determine the timezone that the date is in if a TZID parameter is defined. If it doesn't recognize the timezone (using the "java.util.TimeZone.getTimeZone(String)" method), then it just parses the date according to the JVM's default timezone.
So, with the third example, knowing that it is parsed under the default timezone, you would have to manually convert the "java.util.Date" object to the timezone of your choosing.
Does that help? Is there some feature that you'd like to see added?
-Mike
Hello,
thanks for your fast answer.
In fact, the timezone in which I want to parse my iCal depends on the user who reads it, and must be managed dynamically.
So, I have to change timezones on the fly.
I quickly wrote this method :
Do you see some other date I could have forgot ?
Maybe you can had something like this in your own implementations ;)
Thanks for your help,
Perrine
I'm confused about why you are setting the timezone ID. Calling "setTimezoneId()" has no effect on the property object's date value. The only time the timezone ID is used is when the iCal is written. When an iCal is written, it will format the date according to the property's timezone ID parameter.
Mike
Hm, you're right, I'm sorry, I used to think it would set the date object TimeZone... But, the object is a Date and there is no timezones on Dates objects... really confused !
I think I will take some more time to think about this, hoping I would'nt have to bother you again...
Thanks for your patience ! :D
And good luck for TimeZones!
Yes, Date objects don't have timezones associated with them. Their internal value is UTC time. You can format a Date object in a certain timezone by calling "DateFormat.setTimeZone()":