Filter
Exclude
Time range
-
Near
秋の終了日の午前一時台が2度現れることは、時刻を扱う人は知っておかなければならない。 localtimeはunique keyになれない。
正解は「兄の出生後にサマータイム実施期間が終了し時刻が1時間巻き戻ったから」でした! 2016年11月6日に米国で生じた事例で、双子の兄が午前1:39に出生し、その31分後に弟が出生したのですが午前2時にサマータイムが終了して時刻が1時間巻き戻ったため、弟の出生時刻は午前1:10になりました (混乱)
1
73
やったーAI君が頑張ってLocalTimeからDurationに書き換えてくれて25時以降も対応できました!!!!!!!11!
22
LocalTimeが25時に対応してなかった(´・ω・`)
2
50
Quem é que passou uma manhã inteira a fazer debug em código q estava a funcionar em março e não tinha sido mexido desde essa altura? Tudo para chegar à conclusão que o problema estava na instanciação de uma variável com a data e hora que não estava a usar o localtime
1
5
303
Replying to @ChShersh
Well in c it's because people insist on using localtime() instead of gmtime(). *ALWAYS* store time in gmtime() (or if you only care about seconds time()) and then externalize that time into the local value when it comes time to display it.
80
Replying to @ChShersh
Everyone assumes localtime. 🤣
1
49
What do you guys think — should I travel to another country just to check whether "LocalTime" works or not? 😂 Btw for those who don’t know: "LocalTime" in Java represents only the time (hours, minutes, seconds) without any date or timezone.
1
1
2
140
They are all psychopaths, none of the fields explicitly indicate if they are UTC or localtime.
2
4
1,122
Akhiryna kena masalah TZ juga. Untung di DB nyimpennya localtime. LOL.
1
33
6,481
以下のようにC言語に変換されます。 #include <stdio.h> #include <stdlib.h> #include <stdarg.h> #include <math.h> #include <time.h> #include <string.h> #ifndef M_PI #define M_PI 3.14159265358979323846 #endif void runtime_error(const char *msg); double input_number(void); double read_line_as_number(void); void set_read_delimiter(const char *delimiter); int split_read_line(double *values, int max_values); void read_line_into_vars(int expected_count, ...); int read_line_into_array(int array_idx); void read_binary_byte_into_var(int var_idx); int read_binary_into_array(int array_idx); double safe_div(double left, double right); double safe_sqr(double value); double rnd_basic(double arg); double date_part(double selector); unsigned long long mask_for_bits(int bits); void basic_spc(double count, const char *text); void print_binary(unsigned long long value, int width); void print_array_full(int array_idx); void write_array_bytes(int array_idx); void free_arrays(void); void close_input_file(void); int checked_array_index(int array_idx, double subscript); double get_array_value(int array_idx, double subscript); double *array_element_ptr(int array_idx, double subscript); void dim_array(int array_idx, double upper_bound); int is_eof(void); double vars[26]; double loop_limit[26]; double loop_step[26]; double *arrays[26]; int array_sizes[26]; int array_read_counts[26]; double args_buffer[26]; int args_count = 0; int stack[256]; int sp = 0; double var_stack[1024][26]; int var_sp = 0; double return_reg = 0.0; int current_line = 0; FILE *input_fp = NULL; char read_delimiter[16] = ","; void runtime_error(const char *msg) { fprintf(stderr, "Runtime error at BASIC line %d: %s\n", current_line, msg); exit(1); } double input_number(void) { char buffer[1024]; if (!fgets(buffer, sizeof(buffer), stdin)) { runtime_error("INPUT failed"); } return atof(buffer); } double read_line_as_number(void) { char buffer[1024]; if (input_fp == NULL) { runtime_error("READ input file is not open"); } if (!fgets(buffer, sizeof(buffer), input_fp)) { if (feof(input_fp)) { runtime_error("READ attempted at EOF"); } runtime_error("READ failed"); } return atof(buffer); } void set_read_delimiter(const char *delimiter) { size_t len; if (delimiter == NULL || delimiter[0] == '\0') { runtime_error("Delimiter must not be empty"); } len = strlen(delimiter); if (len >= sizeof(read_delimiter)) { runtime_error("Delimiter is too long"); } memcpy(read_delimiter, delimiter, len 1); } int split_read_line(double *values, int max_values) { char buffer[1024]; char *cursor; size_t delim_len; int count; if (input_fp == NULL) { runtime_error("READ input file is not open"); } if (!fgets(buffer, sizeof(buffer), input_fp)) { if (feof(input_fp)) { runtime_error("READ attempted at EOF"); } runtime_error("READ failed"); } buffer[strcspn(buffer, "\r\n")] = '\0'; if (buffer[0] == '\0') { return 0; } delim_len = strlen(read_delimiter); cursor = buffer; count = 0; while (1) { char *sep = strstr(cursor, read_delimiter); char *token = cursor; char *endptr; double value; if (sep != NULL) { *sep = '\0'; cursor = sep delim_len; } else { cursor = NULL; } value = strtod(token, &endptr); if (endptr == token) { value = 0.0; } if (count < max_values) { values[count] = value; } count; if (cursor == NULL) { break; } } return count; } void read_line_into_vars(int expected_count, ...) { double values[256]; va_list ap; int count; int i; if (expected_count < 0 || expected_count > 256) { runtime_error("READ variable count out of range"); } count = split_read_line(values, expected_count); if (count < expected_count) { runtime_error("READ line has fewer values than expected"); } va_start(ap, expected_count); for (i = 0; i < expected_count; i) { double *dest = va_arg(ap, double *); *dest = values[i]; } va_end(ap); } int read_line_into_array(int array_idx) { double values[2048]; int count; int i; int limit; if (arrays[array_idx] == NULL) { runtime_error("Array used before DIM"); } count = split_read_line(values, 2048); limit = array_sizes[array_idx]; if (count > limit) { count = limit; } for (i = 0; i < count; i) { arrays[array_idx][i 1] = values[i]; } return count; } void read_binary_byte_into_var(int var_idx) { int byte_value; if (input_fp == NULL) { runtime_error("READBIN input file is not open"); } byte_value = fgetc(input_fp); if (byte_value == EOF) { if (ferror(input_fp)) { runtime_error("READBIN failed"); } return; } vars[var_idx] = (double)((unsigned char)byte_value); } int read_binary_into_array(int array_idx) { int count; int byte_value; if (input_fp == NULL) { runtime_error("READBIN input file is not open"); } if (arrays[array_idx] == NULL) { runtime_error("Array used before DIM"); } count = 0; while (count < array_sizes[array_idx]) { byte_value = fgetc(input_fp); if (byte_value == EOF) { if (ferror(input_fp)) { runtime_error("READBIN failed"); } break; } count; arrays[array_idx][count] = (double)((unsigned char)byte_value); } return count; } double safe_div(double left, double right) { if (right == 0.0) { runtime_error("Division by zero"); } return left / right; } double safe_sqr(double value) { if (value < 0.0) { runtime_error("SQR of negative value"); } return sqrt(value); } double rnd_basic(double arg) { (void)arg; return (double)rand() / (double)RAND_MAX; } double date_part(double selector) { time_t now; struct tm local_tm; struct tm *tm_ptr; int part; part = (int)selector; now = time(NULL); tm_ptr = localtime(&now); if (tm_ptr == NULL) { runtime_error("DATE failed"); } local_tm = *tm_ptr; switch (part) { case 0: return (double)(local_tm.tm_year 1900); case 1: return (double)(local_tm.tm_mon 1); case 2: return (double)local_tm.tm_mday; case 3: return (double)local_tm.tm_wday; case 4: return (double)local_tm.tm_hour; case 5: return (double)local_tm.tm_min; case 6: return (double)local_tm.tm_sec; case 7: #ifdef TIME_UTC { struct timespec ts; if (timespec_get(&ts, TIME_UTC) == 0) { runtime_error("DATE failed"); } return (double)(ts.tv_nsec / 1000000L); } #else return 0.0; #endif default: runtime_error("DATE argument out of range"); } return 0.0; } unsigned long long mask_for_bits(int bits) { if (bits <= 0) { return 0ULL; } if (bits >= (int)(sizeof(unsigned long long) * 8)) { return ~0ULL; } return (1ULL << bits) - 1ULL; } void basic_spc(double count, const char *text) { int n; int i; size_t len; if (text == NULL || text[0] == '\0') { text = " "; } n = (int)count; if (n <= 0) { return; } len = strlen(text); for (i = 0; i < n; i) { fwrite(text, 1, len, stdout); } } void print_binary(unsigned long long value, int width) { int i; value &= mask_for_bits(width); for (i = width - 1; i >= 0; --i) { printf("%c", (value & (1ULL << i)) ? '1' : '0'); } } void print_array_full(int array_idx) { int count; int i; if (arrays[array_idx] == NULL) { runtime_error("Array used before DIM"); } count = array_read_counts[array_idx]; if (count <= 0) { count = array_sizes[array_idx]; } if (count > array_sizes[array_idx]) { count = array_sizes[array_idx]; } for (i = 1; i <= count; i) { if (i > 1) { printf("%s", ", "); } printf("%g", arrays[array_idx][i]); } } void write_array_bytes(int array_idx) { int count; int i; if (arrays[array_idx] == NULL) { runtime_error("Array used before DIM"); } count = array_read_counts[array_idx]; if (count <= 0) { count = array_sizes[array_idx]; } if (count > array_sizes[array_idx]) { count = array_sizes[array_idx]; } for (i = 1; i <= count; i) { fputc((unsigned char)((long long)(arrays[array_idx][i])), stdout); } } void close_input_file(void) { if (input_fp != NULL && input_fp != stdin) { fclose(input_fp); } input_fp = NULL; } void free_arrays(void) { int i; for (i = 0; i < 26; i) { free(arrays[i]); arrays[i] = NULL; array_sizes[i] = 0; } } int checked_array_index(int array_idx, double subscript) { int index; if (arrays[array_idx] == NULL) { runtime_error("Array used before DIM"); } if (subscript < 0.0 || floor(subscript) != subscript) { runtime_error("Array index must be a non-negative integer"); } index = (int)subscript; if (index > array_sizes[array_idx]) { runtime_error("Array index out of bounds"); } return index; } double get_array_value(int array_idx, double subscript) { return arrays[array_idx][checked_array_index(array_idx, subscript)]; } double *array_element_ptr(int array_idx, double subscript) { return &arrays[array_idx][checked_array_index(array_idx, subscript)]; } void dim_array(int array_idx, double upper_bound) { size_t count; if (upper_bound < 0.0 || floor(upper_bound) != upper_bound) { runtime_error("DIM size must be a non-negative integer"); } count = (size_t)((int)upper_bound 1); free(arrays[array_idx]); arrays[array_idx] = (double *)calloc(count, sizeof(double)); if (arrays[array_idx] == NULL) { runtime_error("Out of memory during DIM"); } array_sizes[array_idx] = (int)upper_bound; } int is_eof(void) { int ch; if (input_fp == NULL) { return 1; } ch = fgetc(input_fp); if (ch == EOF) { return 1; } if (ungetc(ch, input_fp) == EOF) { runtime_error("Failed to unread input stream"); } return 0; } int main(int argc, char *argv[]) { int i; int line = 10; srand((unsigned int)time(NULL)); for (i = 0; i < 26; i) { arrays[i] = NULL; array_sizes[i] = 0; array_read_counts[i] = 0; } if (argc > 1) { input_fp = fopen(argv[1], "r"); if (input_fp == NULL) { runtime_error("Could not open input file"); } } else { input_fp = stdin; } atexit(free_arrays); atexit(close_input_file); while (line != 0) { switch (line) { case 10: current_line = 10; dim_array(3, 16.0); line = 20; break; line = 20; break; case 20: current_line = 20; vars[0] = 0.0; line = 30; break; line = 30; break; case 30: current_line = 30; line = 40; break; line = 40; break; case 40: current_line = 40; if (is_eof()) { line = 0; break; } else { line = 50; break; } case 50: current_line = 50; if (arrays[3] != NULL) { array_read_counts[3] = read_binary_into_array(3); } else { read_binary_byte_into_var(3); array_read_counts[3] = 0; } line = 60; break; line = 60; break; case 60: current_line = 60; if ((((double)(array_read_counts[3])) == 0.0)) { line = 0; break; } else { line = 70; break; } case 70: current_line = 70; { char format_buffer[1024]; snprintf(format_buffer, sizeof(format_buffer), "X ", (unsigned int)(vars[0])); printf("%s", format_buffer); } line = 80; break; line = 80; break; case 80: current_line = 80; vars[8] = 1.0; loop_limit[8] = ((double)(array_read_counts[3])); loop_step[8] = 1.0; if (loop_step[8] == 0.0) runtime_error("FOR STEP cannot be zero"); if (((loop_step[8] > 0.0) && (vars[8] <= loop_limit[8])) || ((loop_step[8] < 0.0) && (vars[8] >= loop_limit[8]))) { line = 90; } else { line = 110; break; } break; line = 90; break; case 90: current_line = 90; { char format_buffer[1024]; snprintf(format_buffer, sizeof(format_buffer), "X ", (unsigned int)(get_array_value(3, vars[8]))); printf("%s", format_buffer); } line = 100; break; line = 100; break; case 100: current_line = 100; vars[8] = loop_step[8]; if (((loop_step[8] > 0.0) && (vars[8] <= loop_limit[8])) || ((loop_step[8] < 0.0) && (vars[8] >= loop_limit[8]))) { line = 90; } else { line = 110; } break; case 110: current_line = 110; basic_spc(((16.0 - ((double)(array_read_counts[3]))) * 3.0), " "); line = 120; break; line = 120; break; case 120: current_line = 120; vars[8] = 1.0; loop_limit[8] = ((double)(array_read_counts[3])); loop_step[8] = 1.0; if (loop_step[8] == 0.0) runtime_error("FOR STEP cannot be zero"); if (((loop_step[8] > 0.0) && (vars[8] <= loop_limit[8])) || ((loop_step[8] < 0.0) && (vars[8] >= loop_limit[8]))) { line = 130; } else { line = 150; break; } break; line = 130; break; case 130: current_line = 130; if ((get_array_value(3, vars[8]) < 32.0)) { printf("%s", "."); line = 140; break; } else { putchar((unsigned char)(get_array_value(3, vars[8]))); line = 140; break; } case 140: current_line = 140; vars[8] = loop_step[8]; if (((loop_step[8] > 0.0) && (vars[8] <= loop_limit[8])) || ((loop_step[8] < 0.0) && (vars[8] >= loop_limit[8]))) { line = 130; } else { line = 150; } break; case 150: current_line = 150; printf("\n"); line = 160; break; line = 160; break; case 160: current_line = 160; vars[0] = (vars[0] 16.0); line = 170; break; line = 170; break; case 170: current_line = 170; line = 30; break; default: fprintf(stderr, "Line %d not found\n", line); return 1; } } return 0; }

2
140
arch-chroot /mnt/ ln -sf /usr/share/zoneinfo/(your area)/(your location) /etc/localtime hwclock --systohc nvim /etc/locale-gen (uncomment selected locales, save-exit) locale-gen nvim /etc/hostname (make hostname, save-exit)
1
2
11
Replying to @RGGStudio @IGN
Is it a one time broadcast or can I watch it not at 4 am my localtime?
2
1,628
Replying to @Bricktop_NAFO
seismograph data from 40km away nothing of note since 7AM localtime Tel Aviv. that's not 7am sunlight. it didnt happen.
3
527
Jan 26
Replying to @dlouhymichal
To _není_ bug v linuxovém kernelu. To je součástí definice C runtime knihoven už od původního C a unixu. V roce 1970 to bylo nekonečně daleko. A v linuxu to _lze_ dobře řešit - např. tím, že funkce jako localtime atd. budou přeteklé time_t interpretovat od 14.1.2038.
9
732
X Reply Guy Counter Chrome Extension (Open Source) ❌No @X API Needed. ✅Open Source and Free. ✅ Straightforward and No BS. Track the total count of your replies posts in real time. with a reminder, that gets in your way, stops you from doing other browsing stuff, and makes sure you reach your daily targets 😤. Being a reply guy is hard.. and staying on track is even harder. As I began my reply guy journey, I really felt the need for a tool that shows my daily reply count and a progress bar right on the screen in realtime. So I vibe-coded this browser extension which makes sure you reach your daily reply-guy targets every freakin day. Install it in your browser and see your progress in real time, it's styled to blend natively into the X UI so that you don't feel distracted. Daily counter resets automatically as per your localtime and tracks your daily, monthly, and yearly performance. You see live analysis of your reply guy performance and can also export all data as CSV for deeper analysis. Have fun and Be the best reply guy on the timeline.
2
6
496
If you are coding in Java. Then for finding the date and time you have a built-in function. Which is LocalDate and LocalTime. Then just use dot with it and find the different methods to perform operations on it.
1
2
200
#include <iostream> #include <ctime> using namespace std; int main() { time_t now = time(0); tm *currentTime = localtime(&now); int year = currentTime->tm_year 1900; int month = currentTime->tm_mon 1; // January = 1 int day = currentTime->tm_mday; int hour = currentTime->tm_hour; int minute = currentTime->tm_min; if (year == 2025 && month == 12 && day == 31 && (hour > 10 || (hour == 10 && minute > 0))) { cout << "🎓 Congratulations! This User is officially a graduate." << endl; } else { cout << "Examination still ongoing, continue boko and stay focused.😜🥱" << endl; } return 0; }
24
3
201
5,753
18 Dec 2025
One of my favourite Kusto features is the ability to easily query specific days of the week or hours of the day for events. Example below, looking for PIM activations outside of working hours, in this case outside of 6am to 6pm or on weekends. let Saturday = time(6.00:00:00); let Sunday = time(0.00:00:00); AuditLogs | where TimeGenerated < ago(30d) | extend LocalTime=TimeGenerated 5h | where dayofweek(LocalTime) in (Saturday, Sunday) or hourofday(LocalTime) !between (6 .. 18) | where OperationName == "Add member to role completed (PIM activation)"
2
5
57
4,394