Ejemplo n.º 1
0
        public string getCompleteLongDateString()
        {
            bool     dst;
            DateTime dt;

            getLocalTimeEx(out dt, out dst);
            return(string.Format("{0} {1} {2} ({3})", dt.Day, GPAppHelper.getMonthAbr(dt.Month), dt.Year, getDayOfWeekName(dt.DayOfWeek)));
        }
Ejemplo n.º 2
0
        public string getLongDateString()
        {
            bool     dst;
            DateTime dt;

            getLocalTimeEx(out dt, out dst);
            return(string.Format("{0} {1} {2}", dt.Day, GPAppHelper.getMonthAbr(dt.Month), dt.Year));
        }
Ejemplo n.º 3
0
 public static GPAppHelper getShared()
 {
     if (sharedObject == null)
     {
         sharedObject = new GPAppHelper();
     }
     return(sharedObject);
 }
Ejemplo n.º 4
0
        public string getShortTimeString(bool showDstIndicator, ref string dstIndicator)
        {
            bool     dst;
            DateTime dt;

            getLocalTimeEx(out dt, out dst);
            int h = dt.Hour;
            int m = dt.Minute + ((dt.Second > 30) ? 1 : 0);

            if (dstIndicator != null && getLocation().getTimeZone().isSupportDaylightSaving())
            {
                dstIndicator = GPAppHelper.GetDSTSignature(dst ? 1 : 0);
            }

            if (getLocation().getTimeZone().isSupportDaylightSaving() && showDstIndicator)
            {
                if (timeFormat24)
                {
                    return(string.Format("{0:00}:{1:00} ({2})", h, m, GPAppHelper.GetDSTSignature(dst ? 1 : 0)));
                }
                else
                {
                    return(string.Format("{0:00}:{1:00} {2} ({3})", (((h % 12) + 11) % 12 + 1), m, (h >= 12 ? "PM" : "AM"), GPAppHelper.GetDSTSignature(dst ? 1 : 0)));
                }
            }
            else
            {
                if (timeFormat24)
                {
                    return(string.Format("{0:00}:{1:00}", h, m));
                }
                else
                {
                    return(string.Format("{0:00}:{1:00} {2}", (((h % 12) + 11) % 12 + 1), m, (h >= 12 ? "PM" : "AM")));
                }
            }
        }
Ejemplo n.º 5
0
 public string FormatTimeRange(int h1, int m1, int h2, int m2, bool dst)
 {
     if (timeFormat24)
     {
         if (getLocation().getTimeZone().isSupportDaylightSaving())
         {
             return(string.Format("{0:00}:{1:00} - {2:00}:{3:00} ({4})", h1, m1, h2, m2, GPAppHelper.GetDSTSignature(dst ? 1 : 0)));
         }
         else
         {
             return(string.Format("{0:00}:{1:00} - {2:00}:{3:00}", h1, m1, h2, m2));
         }
     }
     else
     {
         if (getLocation().getTimeZone().isSupportDaylightSaving())
         {
             return(string.Format("{0:00}:{1:00} {2} - {3:00}:{4:00} {5} ({6})", (((h1 % 12) + 11) % 12 + 1), m1, (h1 > 12), (((h2 % 12) + 11) % 12 + 1), m2, GPAppHelper.GetDSTSignature(dst ? 1 : 0)));
         }
         else
         {
             return(string.Format("{0:00}:{1:00} {2} - {3:00}:{4:00} {5}", (((h1 % 12) + 11) % 12 + 1), m1, (((h2 % 12) + 11) % 12 + 1), m2));
         }
     }
 }
Ejemplo n.º 6
0
        public string getLongTimeString()
        {
            bool     dst;
            DateTime dt;

            getLocalTimeEx(out dt, out dst);
            if (getLocation().getTimeZone().isSupportDaylightSaving())
            {
                if (timeFormat24)
                {
                    return(string.Format("{0:00}:{1:00}:{2:00} ({3})", dt.Hour, dt.Minute, dt.Second, GPAppHelper.GetDSTSignature(dst ? 1 : 0)));
                }
                else
                {
                    return(string.Format("{0:00}:{1:00}:{2:00} {3} ({4})", (((dt.Hour % 12) + 11) % 12 + 1), dt.Minute, dt.Second, (dt.Hour >= 12 ? "PM" : "AM"), GPAppHelper.GetDSTSignature(dst ? 1 : 0)));
                }
            }
            else
            {
                if (timeFormat24)
                {
                    return(string.Format("{0:00}:{1:00}:{2:00}", dt.Hour, dt.Minute, dt.Second));
                }
                else
                {
                    return(string.Format("{0:00}:{1:00}:{2:00} {3}", (((dt.Hour % 12) + 11) % 12 + 1), dt.Minute, dt.Second, (dt.Hour >= 12 ? "PM" : "AM")));
                }
            }
        }
Ejemplo n.º 7
0
 public string getFullName()
 {
     return(string.Format("{0} {1}", GPAppHelper.GetTextTimeZone(OffsetSeconds), Name));
 }