AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   getting todays date (https://forums.alliedmods.net/showthread.php?t=129055)

reinert 06-08-2010 10:18

getting todays date
 
Hey, how to get today date like: 2010-06-08.

I found this: http://www.amxmodx.org/funcwiki.php?go=func&id=605, but I don't know how to use it.

1 Question more, how can I save it to MySQL, like: ?

PHP Code:

SQL_PrepareQuery(SqlConnection,"UPDATE `user` SET `date`='%i' WHERE `ip`='%s'",dateszIp


Owner123 06-08-2010 10:24

Re: getting todays date
 
PHP Code:

new CurrentTime[9
get_time("%Y-%m-%d",CurrentTime,8

This SQL save is correctly.

FlyingHorse 06-08-2010 10:32

Re: getting todays date
 
PHP Code:

#include <amxmodx>
#include <colorchat>

new PLUGIN[ ] = "Say date"
new VERSION[ ] = "1.0"
new AUTHOR[ ] = "FlyingHorse"


public plugin_init() {
    
register_plugin(PLUGINVERSIONAUTHOR)
    
register_clcmd("say /date""setDate")
    
register_clcmd("say_team /date""setDate")
    
}

public 
setDate(id)
{
    new 
GetDate[9
    
get_time("%Y-%m-%d"GetDate8)  
    
ColorChat(idGREEN"^x01The current date is:^x04 %s"GetDate)



reinert 06-08-2010 10:34

Re: getting todays date
 
Thanks! hope it works. can't continue till This is not working, maybe someone can help me in other thread too ? :)

fysiks 06-08-2010 19:46

Re: getting todays date
 
Quote:

Originally Posted by reinert (Post 1203238)
Thanks! hope it works. can't continue till This is not working, maybe someone can help me in other thread too ? :)

It is not working so you can now continue. LOL. :)

Kreation 06-09-2010 00:16

Re: getting todays date
 
Quote:

Originally Posted by fysiks (Post 1203677)
It is not working so you can now continue. LOL. :)

LOLOL'd.


All times are GMT -4. The time now is 05:25.

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