Yahoo Poland Wyszukiwanie w Internecie

Search results

  1. There is no built-in PHP now() function, but you can do it using date(). Example. function now() { return date('Y-m-d H:i:s'); } You can use date_default_timezone_set() if you need to change timezone. Otherwise you can make use of Carbon - A simple PHP API extension for DateTime.

  2. 23 sty 2009 · The best way to get the current time and date is by the date function in PHP: $date = date('FORMAT'); // FORMAT E.g.: Y-m-d H:i:s $current_date = date('Y-m-d H:i:s'); With the Unix timestamp: $now_date = date('FORMAT', time()); // FORMAT Eg : Y-m-d H:i:s To set the server time zone: date_default_timezone_set('Asia/Calcutta');

  3. In C# .NET, the equivalent of PHP's time() function, which returns the current Unix timestamp, is obtained using the DateTimeOffset.UtcNow property in combination with the DateTimeOffset.ToUnixTimeSeconds() method. Here's an example:

  4. Gets a DateTime object that is set to the current date and time on this computer, expressed as the local time. public: static property DateTime Now { DateTime get (); }; public static DateTime Now { get; } static member Now : DateTime.

  5. The following example uses the Date property to retrieve the current date. It also illustrates how a DateTime value can be formatted using some of the standard date and time format strings.

  6. 21 cze 2022 · Table of Contents. Get the current UTC date/time. Formatting the DateTime string. Get just the time or just the date. Get current time for a specific time zone. Find all time zone ids. What about DateOnly and TimeOnly (.NET 6)? Get the current UTC date/time.

  7. 22 lut 2023 · By using the DateTime.Now property, you can get the current date and time in the local time zone of the computer where the code is running. Additionally, by using the ToString() method, you can format the date and time in a specific way.

  1. Ludzie szukają również