Index: apps/Makefile
===================================================================
--- apps/Makefile	(revision 12966)
+++ apps/Makefile	(working copy)
@@ -54,7 +54,7 @@
    INCLUDES += $(patsubst %,-I%,$(subst :, ,$(APPEXTRA)))
 endif
 
-CFLAGS = $(INCLUDES) $(GCCOPTS) $(TARGET) $(DEFINES) -DTARGET_ID=$(TARGET_ID)	\
+CFLAGS = $(INCLUDES) $(GCCOPTS) $(TARGET) $(BUILDDATE) $(DEFINES) -DTARGET_ID=$(TARGET_ID)	\
  -DAPPSVERSION=\"$(VERSION)\" $(EXTRA_DEFINES) -DMEM=${MEMORYSIZE} \
  -DTARGET_NAME=\"$(ARCHOS)\"
 
Index: apps/menus/settings_menu.c
===================================================================
--- apps/menus/settings_menu.c	(revision 12966)
+++ apps/menus/settings_menu.c	(working copy)
@@ -190,7 +190,7 @@
 
 /* Time & Date */
 #if CONFIG_RTC
-static int timedate_set(void)
+int timedate_set(void)
 {
     struct tm tm;
     int result;
@@ -202,14 +202,20 @@
     /* This prevents problems with time/date setting after a power loss */
     if (!valid_time(&tm))
     {
-        /* hour   */
+/* Macros to convert a 2-digit string to a decimal constant. 
+   (YEAR), MONTH and DAY are set by the date command, which outputs
+   DAY as 00..31 and MONTH as 01..12. The leading zero would lead to
+   misinterpretation as an octal constant. */
+#define S100(x) 1 ## x
+#define C2DIG2DEC(x) (S100(x)-100)
+
         tm.tm_hour = 0;
         tm.tm_min = 0;
         tm.tm_sec = 0;
-        tm.tm_mday = 1;
-        tm.tm_mon = 0;
+        tm.tm_mday = C2DIG2DEC(DAY);
+        tm.tm_mon =  C2DIG2DEC(MONTH)-1;
         tm.tm_wday = 1;
-        tm.tm_year = 100;
+        tm.tm_year = YEAR-1900;
     }
 
     result = (int)set_time_screen(str(LANG_TIME), &tm);
@@ -223,7 +229,8 @@
 MENUITEM_FUNCTION(time_set, 0, ID2P(LANG_TIME), 
                     timedate_set, NULL, NULL, Icon_NOICON);
 MENUITEM_SETTING(timeformat, &global_settings.timeformat, NULL);
-MAKE_MENU(time_menu, ID2P(LANG_TIME_MENU), 0, Icon_NOICON, &time_set, &timeformat);
+MENUITEM_SETTING(rtc_prompt, &global_settings.rtc_prompt, NULL);
+MAKE_MENU(time_menu, ID2P(LANG_TIME_MENU), 0, Icon_NOICON, &time_set, &timeformat, &rtc_prompt);
 #endif
 
 /* System menu */
Index: apps/root_menu.c
===================================================================
--- apps/root_menu.c	(revision 12966)
+++ apps/root_menu.c	(working copy)
@@ -30,6 +30,7 @@
 #include "misc.h"
 #include "rolo.h"
 #include "powermgmt.h"
+#include "settings_menu.h"
 
 #if LCD_DEPTH > 1
 #include "backdrop.h"
@@ -412,6 +413,11 @@
         next_screen = (int)global_status.last_screen;
     else next_screen = global_settings.start_in_screen - 2;
     
+#ifdef CONFIG_RTC
+    if(!valid_time(get_time()) && global_settings.rtc_prompt)
+        timedate_set();
+#endif
+
 #ifdef HAVE_RTC_ALARM
     if ( rtc_check_alarm_started(true) ) 
     {
Index: apps/settings_menu.h
===================================================================
--- apps/settings_menu.h	(revision 12966)
+++ apps/settings_menu.h	(working copy)
@@ -23,5 +23,6 @@
 
 bool settings_menu(void);
 bool manage_settings_menu(void);
+int timedate_set(void); 
 
 #endif
Index: apps/settings.h
===================================================================
--- apps/settings.h	(revision 12966)
+++ apps/settings.h	(working copy)
@@ -437,6 +437,7 @@
     int volume_type;   /* how volume is displayed: 0=graphic, 1=percent */
     int battery_display; /* how battery is displayed: 0=graphic, 1=percent */
     int timeformat;    /* time format: 0=24 hour clock, 1=12 hour clock */
+    bool rtc_prompt;
     bool playlist_shuffle;
     bool play_selected; /* Plays selected file even in shuffle mode */
     int ff_rewind_min_step; /* FF/Rewind minimum step size */
Index: apps/settings_list.c
===================================================================
--- apps/settings_list.c	(revision 12966)
+++ apps/settings_list.c	(working copy)
@@ -439,6 +439,7 @@
     CHOICE_SETTING(0, timeformat, LANG_TIMEFORMAT, 0,
         "time format", "24hour,12hour", NULL, 2,
         ID2P(LANG_24_HOUR_CLOCK), ID2P(LANG_12_HOUR_CLOCK)),
+    OFFON_SETTING(0, rtc_prompt, LANG_RTC_PROMPT, false, "prompt if date is invalid", NULL),
 #endif /* HAVE_LCD_BITMAP */
     OFFON_SETTING(0,show_icons, LANG_SHOW_ICONS ,true,"show icons", NULL),
     /* system */
Index: apps/lang/english.lang
===================================================================
--- apps/lang/english.lang	(revision 12966)
+++ apps/lang/english.lang	(working copy)
@@ -3937,6 +3937,20 @@
   </voice>
 </phrase>
 <phrase>
+  id: LANG_RTC_PROMPT
+  desc: setting to prompt for a time and date on startup when RTC is wrong
+  user:
+  <source>
+    *: "Prompt to Set Time/Date if Invalid"
+  </source>
+  <dest>
+    *: "Prompt to Set Time/Date if Invalid"
+  </dest>
+  <voice>
+    *: "Prompt to Set Time/Date if Invalid"
+  </voice>
+</phrase>
+<phrase>
   id: LANG_12_HOUR_CLOCK
   desc: option for 12 hour clock
   user:
