Convert 'Sat, 24 Nov 2018 00:34:57 GMT' with C to milliseconds [duplicate]
This question is an exact duplicate of:
What is an easy way to parse a date Http Header in C?
1 answer
Tried this, but returns NULL.
struct tm *t = getdate("Sat, 24 Nov 2018 00:34:57 GMT");
I need this to parse HTTP response header.
I believe the format of the date/time here is called RFC 7231.
c linux
marked as duplicate by Swordfish, too honest for this site, M.M
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 24 '18 at 1:44
This question was marked as an exact duplicate of an existing question.
add a comment |
This question is an exact duplicate of:
What is an easy way to parse a date Http Header in C?
1 answer
Tried this, but returns NULL.
struct tm *t = getdate("Sat, 24 Nov 2018 00:34:57 GMT");
I need this to parse HTTP response header.
I believe the format of the date/time here is called RFC 7231.
c linux
marked as duplicate by Swordfish, too honest for this site, M.M
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 24 '18 at 1:44
This question was marked as an exact duplicate of an existing question.
Is the environment variableDATEMSKset to the path of a file that contains a conversion specification that matches that format? Whats the value ofgetdate_erraftergetdate()failed?
– Swordfish
Nov 24 '18 at 1:08
add a comment |
This question is an exact duplicate of:
What is an easy way to parse a date Http Header in C?
1 answer
Tried this, but returns NULL.
struct tm *t = getdate("Sat, 24 Nov 2018 00:34:57 GMT");
I need this to parse HTTP response header.
I believe the format of the date/time here is called RFC 7231.
c linux
This question is an exact duplicate of:
What is an easy way to parse a date Http Header in C?
1 answer
Tried this, but returns NULL.
struct tm *t = getdate("Sat, 24 Nov 2018 00:34:57 GMT");
I need this to parse HTTP response header.
I believe the format of the date/time here is called RFC 7231.
This question is an exact duplicate of:
What is an easy way to parse a date Http Header in C?
1 answer
c linux
c linux
asked Nov 24 '18 at 0:48
exebookexebook
13.1k1575139
13.1k1575139
marked as duplicate by Swordfish, too honest for this site, M.M
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 24 '18 at 1:44
This question was marked as an exact duplicate of an existing question.
marked as duplicate by Swordfish, too honest for this site, M.M
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 24 '18 at 1:44
This question was marked as an exact duplicate of an existing question.
Is the environment variableDATEMSKset to the path of a file that contains a conversion specification that matches that format? Whats the value ofgetdate_erraftergetdate()failed?
– Swordfish
Nov 24 '18 at 1:08
add a comment |
Is the environment variableDATEMSKset to the path of a file that contains a conversion specification that matches that format? Whats the value ofgetdate_erraftergetdate()failed?
– Swordfish
Nov 24 '18 at 1:08
Is the environment variable
DATEMSK set to the path of a file that contains a conversion specification that matches that format? Whats the value of getdate_err after getdate() failed?– Swordfish
Nov 24 '18 at 1:08
Is the environment variable
DATEMSK set to the path of a file that contains a conversion specification that matches that format? Whats the value of getdate_err after getdate() failed?– Swordfish
Nov 24 '18 at 1:08
add a comment |
1 Answer
1
active
oldest
votes
getdate returns NULL on failure and stores the error code in the global variable getdate_err. The meanings of the various error codes can be found here: https://linux.die.net/man/3/getdate_err
The most common error is error code 1, "The DATEMSK environment variable is not defined, or its value is an empty string." For getdate to work on Linux it expects you to have a file containing the format of your getdate strings, and for the environmental variable DATEMSK to point to that file.
An easier approach is to use strptime as detailed in this answer: What is an easy way to parse a date Http Header in C?
add a comment |
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
getdate returns NULL on failure and stores the error code in the global variable getdate_err. The meanings of the various error codes can be found here: https://linux.die.net/man/3/getdate_err
The most common error is error code 1, "The DATEMSK environment variable is not defined, or its value is an empty string." For getdate to work on Linux it expects you to have a file containing the format of your getdate strings, and for the environmental variable DATEMSK to point to that file.
An easier approach is to use strptime as detailed in this answer: What is an easy way to parse a date Http Header in C?
add a comment |
getdate returns NULL on failure and stores the error code in the global variable getdate_err. The meanings of the various error codes can be found here: https://linux.die.net/man/3/getdate_err
The most common error is error code 1, "The DATEMSK environment variable is not defined, or its value is an empty string." For getdate to work on Linux it expects you to have a file containing the format of your getdate strings, and for the environmental variable DATEMSK to point to that file.
An easier approach is to use strptime as detailed in this answer: What is an easy way to parse a date Http Header in C?
add a comment |
getdate returns NULL on failure and stores the error code in the global variable getdate_err. The meanings of the various error codes can be found here: https://linux.die.net/man/3/getdate_err
The most common error is error code 1, "The DATEMSK environment variable is not defined, or its value is an empty string." For getdate to work on Linux it expects you to have a file containing the format of your getdate strings, and for the environmental variable DATEMSK to point to that file.
An easier approach is to use strptime as detailed in this answer: What is an easy way to parse a date Http Header in C?
getdate returns NULL on failure and stores the error code in the global variable getdate_err. The meanings of the various error codes can be found here: https://linux.die.net/man/3/getdate_err
The most common error is error code 1, "The DATEMSK environment variable is not defined, or its value is an empty string." For getdate to work on Linux it expects you to have a file containing the format of your getdate strings, and for the environmental variable DATEMSK to point to that file.
An easier approach is to use strptime as detailed in this answer: What is an easy way to parse a date Http Header in C?
answered Nov 24 '18 at 1:10
seisvelasseisvelas
1,97311124
1,97311124
add a comment |
add a comment |
Is the environment variable
DATEMSKset to the path of a file that contains a conversion specification that matches that format? Whats the value ofgetdate_erraftergetdate()failed?– Swordfish
Nov 24 '18 at 1:08