Thread: vBulletin Time to Java

Results 1 to 5 of 5
  1. #1 vBulletin Time to Java 
    Registered Member
    Tyluur's Avatar
    Join Date
    Jun 2010
    Age
    26
    Posts
    5,103
    Thanks given
    1,819
    Thanks received
    1,767
    Rep Power
    2438
    I need to figure out how to translate this value from a vBulletin Expiry date:

    Code:
    1363737060
    Into something that can be used to give off a date in java.

    Subscriptions.php does this:

    Code:
    $expirydate = vbmktime($vbulletin->GPC['expirydate']['hour']
    Quote Originally Posted by blakeman8192 View Post
    Keep trying. Quitting is the only true failure.
    Spoiler for skrrrrr:

    Attached image
    Reply With Quote  
     

  2. #2  
    Registered Member
    Join Date
    Jan 2010
    Posts
    202
    Thanks given
    12
    Thanks received
    24
    Rep Power
    41
    You understand that this is just a UNIX timestamp right?....
    Reply With Quote  
     

  3. #3  
    Community Veteran

    WH:II:DOW's Avatar
    Join Date
    Dec 2007
    Age
    34
    Posts
    2,017
    Thanks given
    145
    Thanks received
    872
    Rep Power
    4275
    Date (Java 2 Platform SE v1.4.2)

    You can use "Date date = new Date(date)".
    hella titties
    Reply With Quote  
     

  4. #4  
    Registered Member
    Tyluur's Avatar
    Join Date
    Jun 2010
    Age
    26
    Posts
    5,103
    Thanks given
    1,819
    Thanks received
    1,767
    Rep Power
    2438
    Quote Originally Posted by WH:II:DOW View Post
    Date (Java 2 Platform SE v1.4.2)

    You can use "Date date = new Date(date)".
    Code:
    System.out.println(new Date(time).toLocaleString());
    With time:

    1363737000

    Gives

    Jan 16, 1970 10:48:57 AM
    Quote Originally Posted by blakeman8192 View Post
    Keep trying. Quitting is the only true failure.
    Spoiler for skrrrrr:

    Attached image
    Reply With Quote  
     

  5. #5  
    Registered Member
    Join Date
    Jan 2010
    Posts
    202
    Thanks given
    12
    Thanks received
    24
    Rep Power
    41
    Quote Originally Posted by Tyluur View Post
    Code:
    System.out.println(new Date(time).toLocaleString());
    With time:

    1363737000

    Gives

    Jan 16, 1970 10:48:57 AM
    Multiply by 1000, because java.util.Date uses milliseconds, not seconds.

    Working example:

    Code:
    import java.util.Date;
    
    class Main {
    	public static void main (String[] args) {
    		long timestamp = 1363737000;
            	Date time = new Date(timestamp * 1000);
    		System.out.println(time.toLocaleString());
    	}
    }
    Reply With Quote  
     

  6. Thankful user:



Thread Information
Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)


User Tag List

Similar Threads

  1. Java/C++/C/.. services [RSPS/ETC][LIMITED TIME]
    By Killer 99 in forum Selling
    Replies: 29
    Last Post: 01-29-2013, 06:51 AM
  2. [HELP]Adding real-time scanning to an antivirus program with java
    By Zahhak in forum Application Development
    Replies: 4
    Last Post: 12-30-2010, 10:21 PM
  3. Replies: 3
    Last Post: 08-12-2010, 06:24 PM
  4. vBulletin Password+Salt Encryption Through Java? :O
    By d34dly pk3r in forum Requests
    Replies: 0
    Last Post: 08-12-2010, 01:59 PM
  5. Displaying time in a Java format.
    By Scu11 in forum Tutorials
    Replies: 13
    Last Post: 03-16-2008, 08:13 PM
Posting Permissions
  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •