AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   catch a day like MO, TU, ... (https://forums.alliedmods.net/showthread.php?t=26868)

wouter 04-10-2006 12:56

catch a day like MO, TU, ...
 
how does that day returns? i use
Code:
new CurDay[16] get_time("%d",CurDay,15)

would it return: MO or monday?

P34nut 04-10-2006 13:08

that will return the day number: 10

wouter 04-10-2006 13:22

Quote:

Originally Posted by P34nut
that will return the day number: 10

day number 10? *confused only 7 days*
can you explaine that?

pope 04-10-2006 13:35

I believe he means it would return the current numeric day of the month, today being the 10th. :D

Try something like this for day name:

Code:

new CurDay[8]
get_time("%a",CurDay,7)


wouter 04-10-2006 13:38

ok

wouter 04-11-2006 07:27

mhh yes it return the number of the day (11 in this case)
Code:
public day_print(id) {     new CurrentDay[3]     get_time("%d",CurrentDay,2)     client_print(0,3,"The current day is: %s",CurrentDay) }


but is it possible to return the name of the day?
like MO, TU or Monday, Tuesday?

Xanimos 04-11-2006 07:56

try what pope said %a or %A

Quote:

%a abbreviated weekday name (Sun)
%A full weekday name (Sunday)
%b abbreviated month name (Dec)
%B full month name (December)
%c date and time (Dec 2 06:55:15 1979)
%d day of the month (02)
%H hour of the 24-hour day (06)
%I hour of the 12-hour day (06)
%j day of the year, from 001 (335)
%m month of the year, from 01 (12)
%M minutes after the hour (55)
%p AM/PM indicator (AM)
%S seconds after the minute (15)
%U Sunday week of the year, from 00 (48)
%w day of the week, from 0 for Sunday (6)
%W Monday week of the year, from 00 (47)
%x date (Dec 2 1979)
%X time (06:55:15)
%y year of the century, from 00 (79)
%Y year (1979)

wouter 04-11-2006 08:15

oh i thought it was just a letter not a "flag" (so would be the same as "%d")


srry for not trying your advise pope :oops:


All times are GMT -4. The time now is 16:42.

Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.