Strict Standards: Non-static method utf_normalizer::nfc() should not be called statically in /www/htdocs/w006661d/anddev/includes/utf/utf_tools.php on line 1781
[phpBB Debug] PHP Notice: in file /includes/session.php on line 1007: Cannot modify header information - headers already sent by (output started at /includes/utf/utf_tools.php:1781)
[phpBB Debug] PHP Notice: in file /includes/session.php on line 1007: Cannot modify header information - headers already sent by (output started at /includes/utf/utf_tools.php:1781)
[phpBB Debug] PHP Notice: in file /includes/session.php on line 1007: Cannot modify header information - headers already sent by (output started at /includes/utf/utf_tools.php:1781)

Strict Standards: Non-static method utf_normalizer::nfc() should not be called statically in /www/htdocs/w006661d/anddev/includes/utf/utf_tools.php on line 1781

Strict Standards: Non-static method utf_normalizer::nfc() should not be called statically in /www/htdocs/w006661d/anddev/includes/utf/utf_tools.php on line 1781

Strict Standards: Non-static method utf_normalizer::nfc() should not be called statically in /www/htdocs/w006661d/anddev/includes/utf/utf_tools.php on line 1781
[phpBB Debug] PHP Notice: in file /includes/functions.php on line 4362: Cannot modify header information - headers already sent by (output started at /includes/utf/utf_tools.php:1781)
[phpBB Debug] PHP Notice: in file /includes/functions.php on line 4364: Cannot modify header information - headers already sent by (output started at /includes/utf/utf_tools.php:1781)
[phpBB Debug] PHP Notice: in file /includes/functions.php on line 4365: Cannot modify header information - headers already sent by (output started at /includes/utf/utf_tools.php:1781)
[phpBB Debug] PHP Notice: in file /includes/functions.php on line 4366: Cannot modify header information - headers already sent by (output started at /includes/utf/utf_tools.php:1781)
anddev.org • View topic - Miliseconds to normal date

Miliseconds to normal date

Put your problem here if it does not fit any of the other categories.

Miliseconds to normal date

Postby delph » Fri Mar 11, 2011 6:41 pm

Hey community :)
I would like to find out file creation date. As i discovered the way to do it is use file.lastModified()
The problem is this method return long value representing the time the file was last modified, measured in milliseconds since the epoch (00:00:00 GMT, January 1, 1970).

I need to represent this time in normal dd/mm/yyyy - hh:mm:ss format.

Any suggestion regarding this issue ?
Code will be strongly appreciated :)
delph
Freshman
Freshman
 
Posts: 8
Joined: Sat Feb 26, 2011 7:05 am

Top

Re: Miliseconds to normal date

Postby Nomad0404 » Mon Mar 14, 2011 3:26 pm

In Java you do:

Code: Select all
import java.util.*;
import java.text.*;
public class MillisecondToDate {
   public static void main(String[] args)throws Exception {
     long yourmilliseconds = 1119193190;
SimpleDateFormat sdf = new SimpleDateFormat("MMM dd,yyyy HH:mm");

Date resultdate = new Date(yourmilliseconds);
System.out.println(sdf.format(resultdate));  }



Or something similar.

Phil
Nomad0404
Junior Developer
Junior Developer
 
Posts: 19
Joined: Mon Mar 07, 2011 10:23 pm

Top

Return to Other Coding-Problems

Who is online

Users browsing this forum: Google [Bot] and 10 guests