Convert Timezone Using Joda Time

Joda Time provides a quality replacement for the Java date and time classes. The design allows for multiple calendar systems, while still providing a simple API. Converting a Joda DateTime object from one timezone to another is pretty easy and saves you quite a number of lines of code. See method below.

public static Date convertJodaTimezone(LocalDateTime date, String srcTz, String destTz) {
  DateTime srcDateTime = date.toDateTime(DateTimeZone.forID(srcTz));
  DateTime dstDateTime = srcDateTime.withZone(DateTimeZone.forID(destTz));
  return dstDateTime.toLocalDateTime().toDateTime().toDate();
}

Since Joda Time has its own class for storing Date and Calendar objects, the DateTime class has its own toDate() method for converting it to a java.util.Date.

Like what you see? Buy me a cup of coffee. Or subscribe to my feeds.


(7 votes, average: 5.00 out of 5)
 Loading ...

Stock Options At Power Options

Trading stock options is no easy task. You have to know what and how you are going to move next to make it big. It is after all, your money. PowerOptions provides the means, tools, tips, strategy and advice to aid you in your trading stock needs. It is the only internet based data provider that gives investors its patented product called SmartSearchXL, a decision support technology that identifies the highest return option trades giving you better. This is not available anywhere else but PowerOptions. A 14-day free trial is given to you if interested that includes an easy online guide and toll free support.

When looking for the right tools for trading stocks, always think of PowerOptions.: the leading options trading resource on the Web. Sort, filter and analyze all your stock options. That is the convenience offered by PowerOptions. All in the comfort of your home … online.

Like what you see? Buy me a cup of coffee. Or subscribe to my feeds.


(1 votes, average: 5.00 out of 5)
 Loading ...

Change Setting To Open New Tab Instead Of New Window In Safari In Mac OS

safari_iconI have never been an avid fan of Safari because the browser stinks. But after I checked out Safari 4, I noticed its speed and how it handles its resources basing on the performance when I use the browser to surf sites. Even until now though, they still do not provide the option to set Safari to open sites in a new tab instead of a new window.

I know, pretty annoying right? You are doing something, then once you click on a link, all of a sudden a new window pops up instead of a new tab. What is the point in producing a tabbed browser if this option is not provided. For Mac OS users, there is a way to do this but it is not within the browser.

You would have to open the Terminal program located in Applications > Utilities and type the following and press enter.

defaults write com.apple.Safari TargetedClicksCreateTabs -bool true

That is all. Restart your Safari and you should be getting those new tabs that you so desire.

Like what you see? Buy me a cup of coffee. Or subscribe to my feeds.


(5 votes, average: 5.00 out of 5)
 Loading ...

Beware The Wordpress White Screen Of Death

I did try to upgrade my Wordpress to version 2.8 from 2.7. Twice, I could not understand why when I go to my dashboard, the page is just all blank. I quickly cancelled the 2.8 installation and reverted back to version 2.7. Today, when I tried again, I was forced to search for some answers because I got hit by the white screen of death again. I actually did a backup of the database first so I was confident that nothing would go wrong this time. Turns out I was given another problem, the posts did not appear in the blog when I tried to import the backup SQL file to a different blog site.

It seems that in version 2.8, the Wordpress database tables have been renamed like from posts to wp_posts. Still, the white screen of death was a bigger problem for me because I had no idea why. After some searching, the cause of this problem is because some plugins are not compatible with version 2.8. Since your dashboard is now all blank, the only way for you to reset your plugins would be to rename your plugins folder to something else and create a plugins folder. That way, you can see your dashboard again. You can slowly transfer your plugins 1 by 1 and see which one is making it incompatible.

Like what you see? Buy me a cup of coffee. Or subscribe to my feeds.


(8 votes, average: 5.00 out of 5)
 Loading ...