Faker C++
Loading...
Searching...
No Matches
Date.h File Reference
#include <string_view>
#include "faker-cxx/Export.h"
Include dependency graph for Date.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Namespaces

namespace  faker
 
namespace  faker::date
 

Enumerations

enum class  faker::date::DateFormat { faker::date::ISO , faker::date::Timestamp }
 

Functions

FAKER_CXX_EXPORT std::string faker::date::pastDate (int years=1, DateFormat dateFormat=DateFormat::ISO)
 Generates a random date in the past.
 
FAKER_CXX_EXPORT std::string faker::date::futureDate (int years=1, DateFormat dateFormat=DateFormat::ISO)
 Generates a random date in the future.
 
FAKER_CXX_EXPORT std::string faker::date::recentDate (int days=3, DateFormat dateFormat=DateFormat::ISO)
 Generates a random date in the recent past.
 
FAKER_CXX_EXPORT std::string faker::date::soonDate (int days=3, DateFormat dateFormat=DateFormat::ISO)
 Generates a random date in the soon future.
 
FAKER_CXX_EXPORT std::string faker::date::birthdateByAge (int minAge=18, int maxAge=80, DateFormat dateFormat=DateFormat::ISO)
 Generates a random birthdate by age.
 
FAKER_CXX_EXPORT std::string faker::date::birthdateByYear (int minYear=1920, int maxYear=2000, DateFormat dateFormat=DateFormat::ISO)
 Generates a random birthdate by year.
 
FAKER_CXX_EXPORT std::string_view faker::date::weekdayName ()
 Returns a name of random day of the week.
 
FAKER_CXX_EXPORT std::string_view faker::date::weekdayAbbreviatedName ()
 Returns an abbreviated name of random day of the week.
 
FAKER_CXX_EXPORT std::string_view faker::date::monthName ()
 Returns a random name of a month.
 
FAKER_CXX_EXPORT std::string_view faker::date::monthAbbreviatedName ()
 Returns an abbreviated name of random month.
 
FAKER_CXX_EXPORT unsigned faker::date::year ()
 Returns random year.
 
FAKER_CXX_EXPORT unsigned faker::date::month ()
 Returns random month.
 
FAKER_CXX_EXPORT unsigned faker::date::hour ()
 Returns random hour.
 
FAKER_CXX_EXPORT unsigned faker::date::minute ()
 Returns random minute.
 
FAKER_CXX_EXPORT unsigned faker::date::second ()
 Returns random second.
 
FAKER_CXX_EXPORT std::string faker::date::time ()
 Returns random time string.
 
FAKER_CXX_EXPORT unsigned faker::date::dayOfMonth ()
 Returns random day of month.
 
FAKER_CXX_EXPORT unsigned faker::date::dayOfWeek ()
 Returns random day of week.
 
FAKER_CXX_EXPORT std::string_view faker::date::timezoneRandom ()
 Returns random timezone.