The compilation fails because the Time.h file that the compiler finds has nothing to do with time libraries such as that by Paul Stoffregen (https://github.com/PaulStoffregen/Time).

I tried your Sketch, compiled for an Arduino Uno, and saw the same error you see: that Time.h resolves (the file exists somewhere), yet now() is not defined by that Time.h

After searching my Windows PC for a while, I finally found what I think is the file that #include includes on my installation: C:\Users\Brad\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.2\firmwares\wifishield\wifiHD\src\time.h or perhaps C:\Users\Brad\AppData\Local\Arduino15\packages\arduino\tools\avr-gcc\7.3.0-atmel3.6.1-arduino5\avr\include\time.h

Neither of those files defines the now() function.

If you want to use Paul Stoffregen's Time library, download and install it from https://github.com/PaulStoffregen/Time. If instead you wish to use Michael Margolis' Time library, you can find and install it in the Arduino IDE, under Tools / Manage Libraries... and entering "Time" (without quotes) in the search term.

As others have pointed out, the Arduino environment doesn't always know the current date and time. The functions mills() and micros(), return the number of milliseconds or microseconds, respectively, since the Arduino booted. For just looking at the passage of time, most people use millis() or micros() instead of a more complex library.

Answer from Bradford Needham on Stack Overflow
🌐
GitHub
github.com › PaulStoffregen › Time
GitHub - PaulStoffregen/Time: Time library for Arduino · GitHub
Using the Arduino Library Manager, install "Time by Michael Margolis". The code is derived from the Playground DateTime library but is updated to provide an API that is more flexible and easier to use. A primary goal was to enable date and time functionality that can be used with a variety of external time sources with minimum differences required in sketch logic. Example sketches illustrate how similar sketch code can be used with: a Real Time Clock, internet NTP time service, GPS time data, and Serial time messages from a computer for time synchronization.
Starred by 1.3K users
Forked by 688 users
Languages   C++ 64.4% | C 35.6%
🌐
Arduino Libraries
arduinolibraries.info › libraries › time
Time - Arduino Libraries
June 21, 2021 - http://playground.arduino.cc/Code/Time/ Github · https://github.com/PaulStoffregen/Time · Category · Timing · License · Unknown · Library Type · Contributed · Architectures · Any · Date and Time functions, with provisions to synchronize to external time sources like GPS and NTP (Internet).
🌐
Google Groups
groups.google.com › g › dilicdouwhi › c › ZnM8lbNSU00
Download Time.h Library For Arduino
After searching my Windows PC for ... install it from If instead you wish to use Michael Margolis' Time library, you can find and install it in the Arduino IDE, under Tools / Manage Libraries......
🌐
Arduino
playground.arduino.cc › Code › Time
Arduino Playground - Time
There are many convenience macros in TimeLib.h for time constants and conversion of time units. Using the Library Copy the download to the Library directory.
🌐
GitHub
github.com › ebrevdo › arduino › blob › master › libraries › Time › Time.h
arduino/libraries/Time/Time.h at master · ebrevdo/arduino
// intended to include "time.h" from the C library (on ARM, but AVR does not · // have that file at all). On Mac and Windows, the compiler will find this · // "Time.h" instead of the C library "time.h", so we may cause other weird · // and unpredictable effects by conflicting with the C library header "time.h", // but at least this hack lets us define C++ functions as intended.
Author   ebrevdo
🌐
Arduino
arduino.cc › reference › en › libraries › time
Time | Arduino Documentation
August 19, 2022 - Date and Time functions, with provisions to synchronize to external time sources like GPS and NTP (Internet). This library is often used together with TimeAlarms and DS1307RTC.Go to repository
🌐
GitHub
github.com › Patapom › Arduino › blob › master › Libraries › AVR Libc › avr-libc-2.0.0 › include › time.h
Arduino/Libraries/AVR Libc/avr-libc-2.0.0/include/time.h at master · Patapom/Arduino
less permanent storage in RAM. An additional time conversion, isotime() and its re-entrant version, uses far less storage than either ctime() or asctime(). ... Along with the usual smattering of utility functions, such as is_leap_year(), this library includes
Author   Patapom
Find elsewhere
🌐
GitHub
github.com › PaulStoffregen › Time › blob › master › TimeLib.h
Time/TimeLib.h at master · PaulStoffregen/Time
Time library for Arduino. Contribute to PaulStoffregen/Time development by creating an account on GitHub.
Author   PaulStoffregen
🌐
86duino
86duino.com
Arduino Time library | 86Duino
Download · User’s Manual · OS Installation · RoBoIO Library · RoBoIO Wrapper · RoBoIO Application · Board Support Package · BIOS · Other Information · Code & Video · Posted by roboard On 04 / 22 / 2014 0 Comment · TZ_adjust=-8; echo T$(($(date +%s)+60*60*$TZ_adjust)) > /dev/tty.usbserial-A8008pym · TZ_adjust=5.5;d=$(date +%s);t=$(echo "60*60*$TZ_adjust/1" | bc);echo T$(echo $d+$t | bc ) > /dev/ttyACM0 · #include <Time.h> #define TIME_MSG_LEN 11 // time sync to PC is HEADER followed by Unix time_t as ten ASCII digits #define TIME_HEADER 'T' // Header tag for serial time sync mess
🌐
TutorialsPoint
tutorialspoint.com › arduino-time-library-introduction
Arduino Time Library Introduction
August 2, 2021 - The Time library provides you with timekeeping functionality on the Arduino. The latest version of the library is documented here. To install it, search for Time in the Library Manager and install the library by Michael Margolis.You’ll have to
🌐
Arduino Forum
forum.arduino.cc › projects › programming
Confusion with Time.h and TimeLib.h! - Programming - Arduino Forum
January 27, 2017 - Hi, The arduino learning playground is somewhat incomplete, as you can see in this page: Arduino Playground - HomePage First it doesn't says the simple thing of how import the Library, wich one of these is the right …
🌐
Mikaelpatel
mikaelpatel.github.io › Arduino-RTC › de › df7 › time_8h.html
Arduino-RTC: src/Hardware/AVR/time.h File Reference
This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. Definition in file time.h.
🌐
Arduino Forum
forum.arduino.cc › projects › programming
Time.h file missing - Programming - Arduino Forum
November 9, 2018 - I need to use some time functions, but the Time library seems to be missing. I found the timer library, but nothing with the time library. So where has the time liberary gone to? Thanks
🌐
Prometec
prometec.org › advanced-tools › the-new-arduino-time-library
Prometec
Home Advanced Tools · 56 – Variable scope in Arduino. 57 – Arduino and interruptions.. 58 – Infrared sensors. 59 – The new Arduino Time library. 60 – Arduino and RTCs. 61 – Combining several I2C devices. 62 – The analog reference (AREF). 63 – Arduino and Timers.
🌐
GitHub
github.com › brunocalou › Timer
GitHub - brunocalou/Timer: Arduino timer library · GitHub
Download the latest release from github · Unzip and rename the folder to "Timer" (remove the -master) Paste the modified folder on your Library folder (.../Arduino/libraries) Reopen the Arduino IDE · Let's see the basic usage · #include "timer.h" ...
Starred by 54 users
Forked by 18 users
Languages   C++
🌐
Arduino
docs.arduino.cc › retired › archived-libraries › CurieTime
Curie Time Library
March 17, 2022 - We value our legacy, so we make sure to never get rid of our older documentation. In this page, you can find information for all our retired boards, shields, kits and other legacy products. To access The Arduino Playground, our legacy community wiki, you can go to playground.arduino.cc.
🌐
PJRC
pjrc.com › teensy › td_libs_Time.html
Time Library, Timekeeping and Time/Date Manipulation on Teensy
You can open this example from File > Examples > Time > TimeRTCSet. This example requires the DS1307RTC library. If you have trouble with the DS1307, the DS1307RTC library provides 2 example for diagnosing problems and setting the time (without Processing).