# Legato startup date change?

**URL:** <https://forum.legato.io/t/legato-startup-date-change/4238>\
**Category:** Legato Application Framework\
**Created:** [April 1, 2019, 10:23am UTC](https://forum.legato.io/t/legato-startup-date-change/4238 "2019-04-01T10:23:36Z")\
**Posts on this page:** 1\
**Showing post:** 7

<div class="post-metadata">

**Author:** ![lazzox](https://avatars.discourse-cdn.com/v4/letter/l/b9bd4f/32.png) [@lazzox](https://forum.legato.io/u/lazzox)\
**Post date:** [April 3, 2019, 10:26am UTC](https://forum.legato.io/t/legato-startup-date-change/4238/7 "2019-04-03T10:26:49Z")

</div>

#include “legato.h”  
#include “interfaces.h”

```
// NEW_EPOCH_TIME_IN_MS is 2019. 1. 1. 00:00:00:000
#define NEW_EPOCH_TIME_IN_MS 1546300800000

COMPONENT_INIT
{
	const uint64_t newTime = 1546300800000;
    uint64_t msPastEpochPtr = 0;
    LE_INFO("Getting absolute time");
    le_clk_Time_t timeNow = le_clk_GetAbsoluteTime();
    LE_INFO("The time obtained is: %ld", timeNow.usec);
	le_clk_Time_t newTm;

    if((uint64_t)(timeNow.usec) < (newTime)){
    	LE_INFO("Date is sooner than 2019. 1. 1. it is going to be updated!");
    	newTm.usec = newTime;
    	le_clk_SetAbsoluteTime(newTm);
    }else LE_INFO("Readtime: %lld isn't less than %ld", msPastEpochPtr, newTm.usec);

    timeNow = le_clk_GetAbsoluteTime();
    LE_INFO("The time obtained is: %lld", (uint64_t)timeNow.usec);
}

```

From the log (I shortened it a bit to be easier to see):

```
Jan 1 00:31:16 swi-mdm9x28-wp user.info Legato: Getting absolute time
Jan 1 00:31:16 swi-mdm9x28-wp user.info Legato: The time obtained is: 326873
Jan 1 00:31:16 swi-mdm9x28-wp user.info Legato: Time is less than the 2019. 1. 1. it is going to be updated.
Jan 1 00:31:16 swi-mdm9x28-wp user.err Legato: =ERR= | timetestapp[8169]/framework T=main | LE_FILENAME le_clk_SetAbsoluteTime() 597 | Setting CLOCK_REALTIME for Absolute time is not permitted
Jan 1 00:31:16 swi-mdm9x28-wp user.info Legato: The time obtained is: 327150

```

Question was:

> application has to be unsandboxed in order to be able to change the time of the system, am I correct?

---

_[View the full topic](https://forum.legato.io/t/legato-startup-date-change/4238)._
