aspose file tools*
The moose likes Struts and the fly likes Local TimeZone Display Code Help Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Local TimeZone Display Code Help" Watch "Local TimeZone Display Code Help" New topic
Author

Local TimeZone Display Code Help

rajan Kayarohanam
Greenhorn

Joined: Jan 24, 2008
Posts: 12
Dear Moderator,

The Footer of this WEB Application there is a note saying that
"All times above are in your local time zone & format. The current ranch time (not your local time) is Thursday 0:57, US Mountain time (GMT-7)."

We need the implementation of the same. Can you help us in this regard with java Code?

Thanks in Advance,
KMR
[ February 15, 2008: Message edited by: Bear Bibeault ]
saivenu madhav
Greenhorn

Joined: Nov 15, 2007
Posts: 29
Hi mani, I am also looking for this only,other than this, My requirement is like always display local time zone.


I have some clues. In time zone class we have some methods from which we can get browser time zome and from that we need to find out the GMT difference considering DAYLIGHTOFFSAVINGS also,

But i dont have correct code,

Could any one come up with code,It would be really helpful for both of us,


FYI:Moderator... Is it right way of contacting you?If not please guide us.

ThanksInadvance
Madhav
Joe Ess
Bartender

Joined: Oct 29, 2001
Posts: 8927
    
    9

Originally posted by saivenu madhav:

FYI:Moderator... Is it right way of contacting you?If not please guide us.


No. Moderators (here we call them "bartenders") are not responsible for answering questions. Our job is to enforce JavaRanch's single rule: Be Nice. By addressing your question directly to the moderators you are deliberately excluding the 100's of other helpful members of this forum. Of course, since moderators are picked from the most helpful, attractive and brilliant of the JavaRanch's members, they tend to answer more than their share of questions. So to your questions, I will say, your web browser has a "view source" button which will reveal how the JavaRanch knows your local time.
[ February 14, 2008: Message edited by: Joe Ess ]

"blabbing like a narcissistic fool with a superiority complex" ~ N.A.
[How To Ask Questions On JavaRanch]
rajan Kayarohanam
Greenhorn

Joined: Jan 24, 2008
Posts: 12
Hi,

Thanks for your reply... i saw the source code of the JSP, but there is a javascript function called "getRanchTime()" for this problem, but the javascript written in a JS file which is not available.

For your information i have pasted the code below. here there is something called <noscript> tag. i'm not aware of that too.. could you help me in this regard!!!



To Explain the Problem in brief.. The Server for the JavaRanch is located in the US, and When the users from different country post their questions they will be saved in US database of the US Server time, but while displaying them in the JSP page the current local Time of the user is displayed. How is this implemented, it would be great if you could help me in this regard.

Regards,
KMR
Anirvan Majumdar
Ranch Hand

Joined: Feb 22, 2005
Posts: 261
Well, as to not being aware of NOSCRIPT, that is something you should first remedy isn't it?
This will be a good place to start.

As for checking out scripts written in external JS files, you can go about it in 2 ways:
1 => Check out which all script files are getting included in this page from the source. Then enter the URLs into your browser (you might have to take care of relative paths here). And voila! the whole script in plain text in your browser.
2 => Use Firefox, install Firebug, check out the "script" tab. You'll have all referenced scripts downloaded for your leisure perusal.

And lastly, just out of curiosity, why do you think that JSPs are in use here at JavaRanch? Is it because that's what you're also working on?
rajan Kayarohanam
Greenhorn

Joined: Jan 24, 2008
Posts: 12
First i've to thank you for guiding me in NOSCRIPT and getting the JS. i used the first way to get the JS file. Thanks for it. Thanks a lot....

And the question you have asked in the last, i'm not properly getting what do you mean by that. I'm using JSP's in my application is to have ease of maintenance and mostly its to decouple the view and business logic. hopefully JavaRanch also would have implemented for the same reason.

Anyways thanks for your valuable information at this point.

Regards,
KMR
Joe Ess
Bartender

Joined: Oct 29, 2001
Posts: 8927
    
    9

Originally posted by rajan Kayarohanam:
And the question you have asked in the last, i'm not properly getting what do you mean by that.


I think he's referring to the fact that the JavaRanch Saloon uses CGI, not JSP.
rajan Kayarohanam
Greenhorn

Joined: Jan 24, 2008
Posts: 12
Yeah i too feel that JavaRanch is using CGI scripts. But what made JavaRanch to used CGI rather than a JSP? Is there any special reason for this?
Joe Ess
Bartender

Joined: Oct 29, 2001
Posts: 8927
    
    9

what made JavaRanch to used CGI rather than a JSP


My previous post links to the answer from our FAQ.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Local TimeZone Display Code Help