Quantcast
Channel: SA-MP Forums
Viewing all articles
Browse latest Browse all 18226

Tag mismatch from CTime

$
0
0
I'm using the CTime Library Plugin to represent unix timestamps as date and time. To make it a little easier and quicker, I made a function to do this:

Code:

CDate(timestamp, length)
{
        new tm <tmvar>;
       
        localtime(timestamp, tmvar); //Line causing the warning

        switch(length)
        {
                case LONG_DATE: strftime(datetmp, sizeof(datetmp), "%a %d %b, %Y at %H:%M", tmvar); //e.g. Tue 02 Jan, 2018 at 12:38
                case SHORT_DATE: strftime(datetmp, sizeof(datetmp), "%x at %H:%M", tmvar); //e.g. 02/01/2018 at 12:38 (dd/mm/yyyy)
                case JUSTTIME: strftime(datetmp, sizeof(datetmp), "%H:%M", tmvar); //e.g. 12:38
        }

        return datetmp;
}

This works perfectly. However, it seems that passing the "timestamp" argument through "localtime" causes a tag mismatch warning. I've tried everything I can think of and nothing gets rid of the warning. I could just ignore the warning because the code works fine but that just doesn't feel right. :P

Viewing all articles
Browse latest Browse all 18226

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>