Convert 'Sat, 24 Nov 2018 00:34:57 GMT' with C to milliseconds [duplicate]












-1
















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.










share|improve this question













marked as duplicate by Swordfish, too honest for this site, M.M c
Users with the  c badge can single-handedly close c questions as duplicates and reopen them as needed.

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 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


















-1
















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.










share|improve this question













marked as duplicate by Swordfish, too honest for this site, M.M c
Users with the  c badge can single-handedly close c questions as duplicates and reopen them as needed.

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 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
















-1












-1








-1









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.










share|improve this question















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






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Nov 24 '18 at 0:48









exebookexebook

13.1k1575139




13.1k1575139




marked as duplicate by Swordfish, too honest for this site, M.M c
Users with the  c badge can single-handedly close c questions as duplicates and reopen them as needed.

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 c
Users with the  c badge can single-handedly close c questions as duplicates and reopen them as needed.

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 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



















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














1 Answer
1






active

oldest

votes


















0














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?






share|improve this answer






























    1 Answer
    1






    active

    oldest

    votes








    1 Answer
    1






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes









    0














    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?






    share|improve this answer




























      0














      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?






      share|improve this answer


























        0












        0








        0







        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?






        share|improve this answer













        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?







        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered Nov 24 '18 at 1:10









        seisvelasseisvelas

        1,97311124




        1,97311124















            Popular posts from this blog

            Lallio

            Unable to find Lightning Node

            Futebolista