# AT+CCLK weekday bug and workaround

**URL:** <https://forum.sierrawireless.com/t/at-cclk-weekday-bug-and-workaround/5397>\
**Category:** Legacy AirPrime modules\
**Created:** [January 3, 2012, 8:59am UTC](https://forum.sierrawireless.com/t/at-cclk-weekday-bug-and-workaround/5397 "2012-01-03T08:59:58Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![dsanchez](https://avatars.discourse-cdn.com/v4/letter/d/eada6e/32.png) [@dsanchez](https://forum.sierrawireless.com/u/dsanchez)\
**Post date:** [January 3, 2012, 8:59am UTC](https://forum.sierrawireless.com/t/at-cclk-weekday-bug-and-workaround/5397/1 "2012-01-03T08:59:58Z")

</div>

Hi,

When using AT+CCLK to set the time to just before midnight, the weekday is correct, and when it passes to the next day, it is incremented correctly.

The problem is when I set the time to Saturday night, just before midnight, the weekday is 6, until time passes to the next day, then weekday is incremented to 0.  
The problem is also when I set the time to Sunday night, just before midnight, the weekday is 7, until time passes to the next day, then weekday is incremented to 0.

To avoid this problem, I just re send the time using the AT+CCLK command (with the time that I have just read) when weekday is 0.

```auto
void GetTime(adl_rtcTime_t* p_Time)
{
	// Get time
	adl_rtcGetTime(p_Time);
	// Check weekday
	if (p_Time->WeekDay == 0)
	{
		// Workaround
		ascii l_Cmd[32];
		wm_sprintf(l_Cmd, "AT+CCLK=\"%02d/%02d/%02d,%02d:%02d:%02d\"",
				p_Time->Year - 2000, p_Time->Month, p_Time->Day,
				p_Time->Hour, p_Time->Minute, p_Time->Second);
		adl_atCmdCreate ( l_Cmd, ADL_AT_PORT_TYPE(ADL_PORT_UART1, FALSE), 0, NULL );

		// Reload
		adl_rtcGetTime(p_Time);
	}
}
```

Is this bug will be corrected in the next firmware ?

I notice the problem with R7.43, R7.44 and R7.45 firmware. I didn’t test the R7.46 firmware…

Thanks

---

<div class="post-metadata">

**Author:** ![Moderator1](https://avatars.discourse-cdn.com/v4/letter/m/9fc348/32.png) [@Moderator1](https://forum.sierrawireless.com/u/Moderator1)\
**Post date:** [January 4, 2012, 9:49am UTC](https://forum.sierrawireless.com/t/at-cclk-weekday-bug-and-workaround/5397/2 "2012-01-04T09:49:21Z")

</div>

Hi David,

This is a known problem and a tracker already exists for the same.Will update you on this when the tracker is resolved.

---

<div class="post-metadata">

**Author:** ![dsanchez](https://avatars.discourse-cdn.com/v4/letter/d/eada6e/32.png) [@dsanchez](https://forum.sierrawireless.com/u/dsanchez)\
**Post date:** [January 4, 2012, 10:12am UTC](https://forum.sierrawireless.com/t/at-cclk-weekday-bug-and-workaround/5397/3 "2012-01-04T10:12:21Z")

</div>

> [@Moderator](#):
>
> Hi David,
> 
> This is a known problem and a tracker already exists for the same.Will update you on this when the tracker is resolved.

Thanks !

---

<div class="post-metadata">

**Author:** ![awneil](https://avatars.discourse-cdn.com/v4/letter/a/49beb7/32.png) [@awneil](https://forum.sierrawireless.com/u/awneil)\
**Post date:** [January 4, 2012, 9:30pm UTC](https://forum.sierrawireless.com/t/at-cclk-weekday-bug-and-workaround/5397/4 "2012-01-04T21:30:01Z")

</div>

> [@Moderator](#):
>
> This is a known problem and a tracker already exists for the same.Will update you on this when the tracker is resolved.

It would be really, really, really useful if these “trackers” were visible to users ❗

---

<div class="post-metadata">

**Author:** ![victorjd](https://avatars.discourse-cdn.com/v4/letter/v/9fc348/32.png) [@victorjd](https://forum.sierrawireless.com/u/victorjd)\
**Post date:** [January 5, 2012, 9:48am UTC](https://forum.sierrawireless.com/t/at-cclk-weekday-bug-and-workaround/5397/5 "2012-01-05T09:48:09Z")

</div>

> [@awneil](#):
>
> It would be really, really, really useful if these “trackers” were visible to users

+1

---

<div class="post-metadata">

**Author:** ![zafer](https://avatars.discourse-cdn.com/v4/letter/z/439d5e/32.png) [@zafer](https://forum.sierrawireless.com/u/zafer)\
**Post date:** [January 9, 2012, 3:08pm UTC](https://forum.sierrawireless.com/t/at-cclk-weekday-bug-and-workaround/5397/6 "2012-01-09T15:08:10Z")

</div>

> [@awneil](#):
>
> It would be really, really, really useful if these “trackers” were visible to users ❗

I aggree. Because i have a similar problem with weekOfDay parameter. i solved it somehow but i would want to track it.

---

<div class="post-metadata">

**Author:** ![Rex\_alex](https://avatars.discourse-cdn.com/v4/letter/r/73ab20/32.png) [@Rex\_alex](https://forum.sierrawireless.com/u/Rex_alex)\
**Post date:** [September 26, 2012, 6:53am UTC](https://forum.sierrawireless.com/t/at-cclk-weekday-bug-and-workaround/5397/7 "2012-09-26T06:53:16Z")

</div>

Hi,

The tracker is fixed and the problem is corrected in framework 2.51(OS 6.41,firmware R7.51).

Thanks.
