How to transform 01012010 style dates to normal?
#1

Hi. I have dates in format 01012010 ([day][month][year]).
It's with leading zeros. I want to get day, month, year from this. (ex. day = 1, month = 1, year = 2010)

It will be something like UncodeDate(datecode, &day, &month, &year); but I don't know how to wrote this.

Thanks.
Reply
#2

you need this?

Код:
stock GetDMY(&day, &month, &year)
{
	new d, m, y;
	getdate(y, m, d);
	day = d;
	month = m;
	year = y;
	return 1;
}
Reply
#3

Quote:
Originally Posted by © ŦĥЗ ǺĽẽẌṖŎịŚỘń
you need this?

Код:
stock GetDMY(&day, &month, &year)
{
	new d, m, y;
	getdate(y, m, d);
	day = d;
	month = m;
	year = y;
	return 1;
}
What a dumb function lol, all you basically did was rename getdate to GetDMY.
Reply
#4

Quote:
Originally Posted by © ŦĥЗ ǺĽẽẌṖŎịŚỘń
you need this?

Код:
stock GetDMY(&day, &month, &year)
{
	new d, m, y;
	getdate(y, m, d);
	day = d;
	month = m;
	year = y;
	return 1;
}
lmao

pawn Код:
//well anyways here is it, not tested

//lets say you have stored the value in a string called "Date"
new Date[2],Month[2],Year[2];
strmid(Day, Date, 0, 1);
strmid(Day, Month, 2, 3);
strmid(Day, Year, 4, 7);
Reply
#5

A refresh!
Reply
#6

Код:
GetDMY(&day, &month, &year)
{
getdate(year, month, day);
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)