Convert Filetime to time (from variable) PHP [duplicate]
This question already has an answer here:
Convert Windows Timestamp to date using PHP on a Linux Box
2 answers
I have a filetime time of '131841804730412861'
I do not have a file, I have a filetime coming from an API
I am trying to convert it to a "normal" time
Is there a way to decode filetime from a varible in php seeing as Microsoft Filetime has an epoch of Jan 1, 1601 and uses microseconds?
php filetime
marked as duplicate by Andreas, deceze♦
StackExchange.ready(function() {
if (StackExchange.options.isMobile) return;
$('.dupe-hammer-message-hover:not(.hover-bound)').each(function() {
var $hover = $(this).addClass('hover-bound'),
$msg = $hover.siblings('.dupe-hammer-message');
$hover.hover(
function() {
$hover.showInfoMessage('', {
messageElement: $msg.clone().show(),
transient: false,
position: { my: 'bottom left', at: 'top center', offsetTop: -7 },
dismissable: false,
relativeToBody: true
});
},
function() {
StackExchange.helpers.removeMessages();
}
);
});
});
Nov 21 '18 at 13:59
This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.
|
show 6 more comments
This question already has an answer here:
Convert Windows Timestamp to date using PHP on a Linux Box
2 answers
I have a filetime time of '131841804730412861'
I do not have a file, I have a filetime coming from an API
I am trying to convert it to a "normal" time
Is there a way to decode filetime from a varible in php seeing as Microsoft Filetime has an epoch of Jan 1, 1601 and uses microseconds?
php filetime
marked as duplicate by Andreas, deceze♦
StackExchange.ready(function() {
if (StackExchange.options.isMobile) return;
$('.dupe-hammer-message-hover:not(.hover-bound)').each(function() {
var $hover = $(this).addClass('hover-bound'),
$msg = $hover.siblings('.dupe-hammer-message');
$hover.hover(
function() {
$hover.showInfoMessage('', {
messageElement: $msg.clone().show(),
transient: false,
position: { my: 'bottom left', at: 'top center', offsetTop: -7 },
dismissable: false,
relativeToBody: true
});
},
function() {
StackExchange.helpers.removeMessages();
}
);
});
});
Nov 21 '18 at 13:59
This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.
Did you google the function you are trying to use? php.net/manual/en/function.date.php
– Andreas
Nov 21 '18 at 13:27
seems like there is to many numbers tho
– Stender
Nov 21 '18 at 13:35
It might be a lot of numbers but it does decode to an actual date - silisoftware.com/tools/…
– Christopher Taylor
Nov 21 '18 at 13:37
1
Why on earth do you need a filetime that dates back to 1601? That is several hundred years before any computer was invented. What kind of "file" is this filetime from?
– Andreas
Nov 21 '18 at 13:40
I must have misworded it, I was just saying that Microsoft Filettimehas an epoch of Jan 1, 1601
– Christopher Taylor
Nov 21 '18 at 13:41
|
show 6 more comments
This question already has an answer here:
Convert Windows Timestamp to date using PHP on a Linux Box
2 answers
I have a filetime time of '131841804730412861'
I do not have a file, I have a filetime coming from an API
I am trying to convert it to a "normal" time
Is there a way to decode filetime from a varible in php seeing as Microsoft Filetime has an epoch of Jan 1, 1601 and uses microseconds?
php filetime
This question already has an answer here:
Convert Windows Timestamp to date using PHP on a Linux Box
2 answers
I have a filetime time of '131841804730412861'
I do not have a file, I have a filetime coming from an API
I am trying to convert it to a "normal" time
Is there a way to decode filetime from a varible in php seeing as Microsoft Filetime has an epoch of Jan 1, 1601 and uses microseconds?
This question already has an answer here:
Convert Windows Timestamp to date using PHP on a Linux Box
2 answers
php filetime
php filetime
edited Nov 21 '18 at 13:41
asked Nov 21 '18 at 13:25
Christopher Taylor
134
134
marked as duplicate by Andreas, deceze♦
StackExchange.ready(function() {
if (StackExchange.options.isMobile) return;
$('.dupe-hammer-message-hover:not(.hover-bound)').each(function() {
var $hover = $(this).addClass('hover-bound'),
$msg = $hover.siblings('.dupe-hammer-message');
$hover.hover(
function() {
$hover.showInfoMessage('', {
messageElement: $msg.clone().show(),
transient: false,
position: { my: 'bottom left', at: 'top center', offsetTop: -7 },
dismissable: false,
relativeToBody: true
});
},
function() {
StackExchange.helpers.removeMessages();
}
);
});
});
Nov 21 '18 at 13:59
This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.
marked as duplicate by Andreas, deceze♦
StackExchange.ready(function() {
if (StackExchange.options.isMobile) return;
$('.dupe-hammer-message-hover:not(.hover-bound)').each(function() {
var $hover = $(this).addClass('hover-bound'),
$msg = $hover.siblings('.dupe-hammer-message');
$hover.hover(
function() {
$hover.showInfoMessage('', {
messageElement: $msg.clone().show(),
transient: false,
position: { my: 'bottom left', at: 'top center', offsetTop: -7 },
dismissable: false,
relativeToBody: true
});
},
function() {
StackExchange.helpers.removeMessages();
}
);
});
});
Nov 21 '18 at 13:59
This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.
Did you google the function you are trying to use? php.net/manual/en/function.date.php
– Andreas
Nov 21 '18 at 13:27
seems like there is to many numbers tho
– Stender
Nov 21 '18 at 13:35
It might be a lot of numbers but it does decode to an actual date - silisoftware.com/tools/…
– Christopher Taylor
Nov 21 '18 at 13:37
1
Why on earth do you need a filetime that dates back to 1601? That is several hundred years before any computer was invented. What kind of "file" is this filetime from?
– Andreas
Nov 21 '18 at 13:40
I must have misworded it, I was just saying that Microsoft Filettimehas an epoch of Jan 1, 1601
– Christopher Taylor
Nov 21 '18 at 13:41
|
show 6 more comments
Did you google the function you are trying to use? php.net/manual/en/function.date.php
– Andreas
Nov 21 '18 at 13:27
seems like there is to many numbers tho
– Stender
Nov 21 '18 at 13:35
It might be a lot of numbers but it does decode to an actual date - silisoftware.com/tools/…
– Christopher Taylor
Nov 21 '18 at 13:37
1
Why on earth do you need a filetime that dates back to 1601? That is several hundred years before any computer was invented. What kind of "file" is this filetime from?
– Andreas
Nov 21 '18 at 13:40
I must have misworded it, I was just saying that Microsoft Filettimehas an epoch of Jan 1, 1601
– Christopher Taylor
Nov 21 '18 at 13:41
Did you google the function you are trying to use? php.net/manual/en/function.date.php
– Andreas
Nov 21 '18 at 13:27
Did you google the function you are trying to use? php.net/manual/en/function.date.php
– Andreas
Nov 21 '18 at 13:27
seems like there is to many numbers tho
– Stender
Nov 21 '18 at 13:35
seems like there is to many numbers tho
– Stender
Nov 21 '18 at 13:35
It might be a lot of numbers but it does decode to an actual date - silisoftware.com/tools/…
– Christopher Taylor
Nov 21 '18 at 13:37
It might be a lot of numbers but it does decode to an actual date - silisoftware.com/tools/…
– Christopher Taylor
Nov 21 '18 at 13:37
1
1
Why on earth do you need a filetime that dates back to 1601? That is several hundred years before any computer was invented. What kind of "file" is this filetime from?
– Andreas
Nov 21 '18 at 13:40
Why on earth do you need a filetime that dates back to 1601? That is several hundred years before any computer was invented. What kind of "file" is this filetime from?
– Andreas
Nov 21 '18 at 13:40
I must have misworded it, I was just saying that Microsoft Filettimehas an epoch of Jan 1, 1601
– Christopher Taylor
Nov 21 '18 at 13:41
I must have misworded it, I was just saying that Microsoft Filettimehas an epoch of Jan 1, 1601
– Christopher Taylor
Nov 21 '18 at 13:41
|
show 6 more comments
2 Answers
2
active
oldest
votes
date(); takes format as first argument Documentation
Mainly You want to do something like:
$filename = 'somefile.txt';
if (file_exists($filename)) {
echo "$filename was last modified: " . date ("F d Y H:i:s.", filemtime($filename));
}
btw. Number You gave in question is too large.
add a comment |
filemtime
— Gets file modification time and it returns the time the file was last modified, or FALSE on failure. The time is returned as a Unix timestamp, which is suitable for the date()
function.
So, this should work for you but I've a doubt that your given string '131841804730412861' is a valid unix timestamp because too high in lenght.
date ("F d Y H:i:s.", filemtime($filename));
add a comment |
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
date(); takes format as first argument Documentation
Mainly You want to do something like:
$filename = 'somefile.txt';
if (file_exists($filename)) {
echo "$filename was last modified: " . date ("F d Y H:i:s.", filemtime($filename));
}
btw. Number You gave in question is too large.
add a comment |
date(); takes format as first argument Documentation
Mainly You want to do something like:
$filename = 'somefile.txt';
if (file_exists($filename)) {
echo "$filename was last modified: " . date ("F d Y H:i:s.", filemtime($filename));
}
btw. Number You gave in question is too large.
add a comment |
date(); takes format as first argument Documentation
Mainly You want to do something like:
$filename = 'somefile.txt';
if (file_exists($filename)) {
echo "$filename was last modified: " . date ("F d Y H:i:s.", filemtime($filename));
}
btw. Number You gave in question is too large.
date(); takes format as first argument Documentation
Mainly You want to do something like:
$filename = 'somefile.txt';
if (file_exists($filename)) {
echo "$filename was last modified: " . date ("F d Y H:i:s.", filemtime($filename));
}
btw. Number You gave in question is too large.
answered Nov 21 '18 at 13:32
Khazul
1566
1566
add a comment |
add a comment |
filemtime
— Gets file modification time and it returns the time the file was last modified, or FALSE on failure. The time is returned as a Unix timestamp, which is suitable for the date()
function.
So, this should work for you but I've a doubt that your given string '131841804730412861' is a valid unix timestamp because too high in lenght.
date ("F d Y H:i:s.", filemtime($filename));
add a comment |
filemtime
— Gets file modification time and it returns the time the file was last modified, or FALSE on failure. The time is returned as a Unix timestamp, which is suitable for the date()
function.
So, this should work for you but I've a doubt that your given string '131841804730412861' is a valid unix timestamp because too high in lenght.
date ("F d Y H:i:s.", filemtime($filename));
add a comment |
filemtime
— Gets file modification time and it returns the time the file was last modified, or FALSE on failure. The time is returned as a Unix timestamp, which is suitable for the date()
function.
So, this should work for you but I've a doubt that your given string '131841804730412861' is a valid unix timestamp because too high in lenght.
date ("F d Y H:i:s.", filemtime($filename));
filemtime
— Gets file modification time and it returns the time the file was last modified, or FALSE on failure. The time is returned as a Unix timestamp, which is suitable for the date()
function.
So, this should work for you but I've a doubt that your given string '131841804730412861' is a valid unix timestamp because too high in lenght.
date ("F d Y H:i:s.", filemtime($filename));
edited Nov 21 '18 at 13:40
answered Nov 21 '18 at 13:30
Curious_Mind
14.5k32443
14.5k32443
add a comment |
add a comment |
Did you google the function you are trying to use? php.net/manual/en/function.date.php
– Andreas
Nov 21 '18 at 13:27
seems like there is to many numbers tho
– Stender
Nov 21 '18 at 13:35
It might be a lot of numbers but it does decode to an actual date - silisoftware.com/tools/…
– Christopher Taylor
Nov 21 '18 at 13:37
1
Why on earth do you need a filetime that dates back to 1601? That is several hundred years before any computer was invented. What kind of "file" is this filetime from?
– Andreas
Nov 21 '18 at 13:40
I must have misworded it, I was just saying that Microsoft Filettimehas an epoch of Jan 1, 1601
– Christopher Taylor
Nov 21 '18 at 13:41