-2

I want take when i am switched on my system,that time,i want to take that time(SYSTEM TIME) or (SERVER TIME) in php,bcz when user switched on system i want store that time in logintime for login table,how can do

Ramesh R
  • 9
  • 5
  • You can probably use date() function or DateTime class for that – Muriano May 12 '16 at 09:34
  • You didnt even bother to research your question before posting. `date()` is a highly documented function and easily findable through Google. – Wobbles May 12 '16 at 09:35
  • http://stackoverflow.com/a/8050547/3548072 Check this link to get the local system time in PHP – ARUN G May 12 '16 at 09:45
  • 1
    Possible duplicate of [Get current date and time in PHP](http://stackoverflow.com/questions/470617/get-current-date-and-time-in-php) – Bonatti May 12 '16 at 11:32

1 Answers1

0

date() function is what you are looking for.

$today = date("Y-m-d H:i:s");// 2001-03-10 17:16:18 (the MySQL DATETIME format)
Ergo
  • 44
  • 2