• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Local TimeZone Display Code Help

 
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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 ]
 
Greenhorn
Posts: 29
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
Bartender
Posts: 9626
16
Mac OS X Linux Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

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 ]
 
rajan Kayarohanam
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
Ranch Hand
Posts: 261
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 12
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 9626
16
Mac OS X Linux Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

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
Posts: 12
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 9626
16
Mac OS X Linux Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

what made JavaRanch to used CGI rather than a JSP



My previous post links to the answer from our FAQ.
 
You will always be treated with dignity. Now, strip naked, get on the probulator and hold this tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic