Files
Wrench-ApiTester/public/myfit/CONFIGURE.php
T
dev-chiefworks 5f6877e912 myfit added
2023-02-18 18:03:38 -05:00

27 lines
776 B
PHP

<?php
$myfile = fopen("../../writable/myfit_session.txt", "r");
$session_token = fgets($myfile);
$member_id = fgets($myfile);
$guid = fgets($myfile);
fclose($myfile);
// Find a randomDate between $start_date and $end_date
function randomDate($start_date, $end_date)
{
// Convert to timetamps
$min = strtotime($start_date);
$max = strtotime($end_date);
// Generate random number using above bounds
$val = rand($min, $max);
// Convert back to desired date format
return date('Y-m-d H:i:s', $val);
}
function randomDateInRange(DateTime $start, DateTime $end) {
$randomTimestamp = mt_rand($start->getTimestamp(), $end->getTimestamp());
$randomDate = new DateTime();
$randomDate->setTimestamp($randomTimestamp);
return $randomDate;
}