Index: trunk/tools/wmib/Core.cs |
— | — | @@ -768,6 +768,15 @@ |
769 | 769 | return null; |
770 | 770 | } |
771 | 771 | |
| 772 | + public static string timedateToString(int number) |
| 773 | + { |
| 774 | + if (number <= 9 && number >= 0) |
| 775 | + { |
| 776 | + return "0"+number.ToString(); |
| 777 | + } |
| 778 | + return number.ToString(); |
| 779 | + } |
| 780 | + |
772 | 781 | /// <summary> |
773 | 782 | /// Send a message to channel |
774 | 783 | /// </summary> |
— | — | @@ -874,11 +883,11 @@ |
875 | 884 | string log; |
876 | 885 | if (!noac) |
877 | 886 | { |
878 | | - log = "[" + System.DateTime.Now.Hour + ":" + System.DateTime.Now.Minute + ":" + System.DateTime.Now.Second + "] * " + user + " " + message + "\n"; |
| 887 | + log = "[" + timedateToString(System.DateTime.Now.Hour) + ":" + timedateToString(System.DateTime.Now.Minute) + ":" + timedateToString( System.DateTime.Now.Second) + "] * " + user + " " + message + "\n"; |
879 | 888 | } |
880 | 889 | else |
881 | 890 | { |
882 | | - log = "[" + System.DateTime.Now.Hour + ":" + System.DateTime.Now.Minute + ":" + System.DateTime.Now.Second + "] " + "<" + user + "> " + message + "\n"; |
| 891 | + log = "[" + timedateToString( System.DateTime.Now.Hour) + ":" + timedateToString( System.DateTime.Now.Minute ) + ":" + timedateToString( System.DateTime.Now.Second) + "] " + "<" + user + ">\t " + message + "\n"; |
883 | 892 | } |
884 | 893 | System.IO.File.AppendAllText(channel.log + System.DateTime.Now.Year + System.DateTime.Now.Month + System.DateTime.Now.Day +".txt", log); |
885 | 894 | } |