AI 资讯
Tokens: Why ChatGPT Can't Count the R's in 'Strawberry'
You see words. A language model sees tokens — chunks of text, usually a few characters each. Everything starts here. Day 2 of my AIFromZero series. Text gets shattered into tokens "unbelievable" → ["un", "bel", "iev", "able"] (4 tokens, not 1 word, not 12 letters) Before any "thinking", your text is chopped into tokens and each becomes a number the model processes. Why not words or letters? Letters : too fine — the model would relearn spelling everywhere. Whole words : too many — millions, plus every typo and name. Subword tokens : the sweet spot. Common words = 1 token; rare words split into reusable pieces. A fixed ~100k-token vocabulary covers any text. The ~4-chars rule (and why it costs you) In English, ~4 characters ≈ 1 token , or ~0.75 tokens per word. This is how everything is priced and limited: API bills are per token (prompt + reply). A "context window" (how much it can read at once) is measured in tokens — 1,000 tokens ≈ 750 words. Verbose prompts and long chat history burn tokens. Concise prompting is a real cost lever. The strawberry problem The model never sees s-t-r-a-w-b-e-r-r-y. It sees a token like straw + berry . The individual letters are buried inside tokens, so counting characters is genuinely hard for it. It's not dumb — it just doesn't read letters. Tokens are step 1 of everything Tokenize → turn each token into a vector (embeddings, next) → run through the transformer → predict the next token. Every LLM starts exactly here. 🔤 Type anything and watch it tokenize live: https://dev48v.infy.uk/ai/days/day2-tokens.html Day 2 of AIFromZero.
AI 资讯
I Built Minesweeper in ~50 Lines — the Only Hard Part Is Flood-Fill
Minesweeper feels intricate — numbers, cascading reveals, flags. Build it and you find it's a grid, a neighbour count, and one recursive function . This is Day 6 of my GameFromZero series. Each cell holds four facts const cell = { mine : false , open : false , flag : false , n : 0 }; n = how many of the 8 neighbours are mines. That number is all the player gets to reason about. Count neighbours once After scattering mines randomly, precompute every non-mine cell's n : let n = 0 ; neighbours ( r , c , ( rr , cc ) => { if ( cells [ rr ][ cc ]. mine ) n ++ ; }); cell . n = n ; Flood-fill is the whole trick When you open a cell with zero neighbouring mines, there's nothing dangerous nearby — so auto-open all 8 neighbours, and if any of those are also zero, they cascade. That's why one click can clear half the board. It's recursion: function open ( r , c ) { const cell = cells [ r ][ c ]; if ( cell . open || cell . flag ) return ; // base case cell . open = true ; if ( cell . n === 0 ) neighbours ( r , c , ( rr , cc ) => open ( rr , cc )); // recurse } This is the same algorithm behind the paint-bucket tool and maze region-filling. Flags + win/lose Right-click toggles a flag (and blocks accidental opens). Click a mine → lose. Win when opened cells = total − mines: if ( cell . mine ) gameOver (); if ( opened === R * C - M ) win (); That's the entire game. Master the state-step-draw loop once and every classic — Snake, Pong, Tetris, 2048, Minesweeper — is an evening each. ▶️ Play it + read the step-by-step breakdown: https://dev48v.infy.uk/game/day6-minesweeper.html Day 6 of GameFromZero.
AI 资讯
I Built 'Chat With Your Docs' From Scratch — Supabase + pgvector + a Free Local Embedder
"Chat with your PDF / your notes / your docs" is everywhere. Today we build it from scratch and you'll see it's just three moves : retrieve, then generate — with one prompt trick that stops the hallucinations. This is Day 46 of TechFromZero. Yesterday (Day 45) we built the retrieval half with pgvector. Today we add the answer half and host it on Supabase. RAG in one line Find the relevant chunks of your documents, paste them into the prompt, and tell the model to answer using only those. That's Retrieval-Augmented Generation. The "augmented" part is just stuffing real context into the prompt so the model isn't guessing from memory. 1. Storage: Supabase is Postgres, so pgvector is one click Supabase is hosted Postgres with an auto-generated API. Because it's just Postgres , vector search needs no separate database: create extension if not exists vector ; create table documents ( id bigserial primary key , content text , embedding vector ( 384 ) ); -- one RPC the app calls to get the closest chunks create function match_documents ( query_embedding vector ( 384 ), match_count int ) returns table ( id bigint , content text , similarity float ) language sql stable as $$ select id , content , 1 - ( embedding <=> query_embedding ) as similarity from documents order by embedding <=> query_embedding limit match_count ; $$ ; 2. Ingest: chunk → embed → store Split your docs into paragraph-sized chunks, embed each with a free local model (all-MiniLM-L6-v2 via Transformers.js — no key, nothing leaves your machine), and insert the row + vector: const embedding = await embed ( chunk ); // 384 numbers await supabase . from ( " documents " ). insert ({ content : chunk , embedding }); Chunk size matters: too big buries the answer in noise, too small loses meaning. A few hundred characters is a good start. 3. Retrieve + Generate (the payoff) Embed the question with the same model, ask Supabase for the closest chunks, then hand them to the LLM: const query_embedding = await embed ( que
AI 资讯
I built a free Python AI platform for Indian developers. Here's everything inside.
6 months ago I was a final year CS student with no real projects and no clear path into tech. So I built one. Not just a project. A full platform. Here's everything inside Rohith Builds — completely free, forever. What's Inside 1. 100 Structured Lessons (Python → AI) Not random tutorials. A structured path: Day 1-20: Python basics Day 21-40: Backend & APIs Day 41-60: SQL & Databases Day 61-80: AI & LLMs Day 81-100: AI Agents & Launch Every lesson uses Indian examples. Zomato orders. Cricket scores. IRCTC bookings. Aadhaar validation. Because most tutorials use pizza and baseball. We use what we actually know. 2. Rohi — AI Tutor Stuck on a concept? Ask Rohi. he's powered by Groq LLM, understands Indian context, and is available 24/7. No waiting for a mentor to reply. No expensive bootcamp. Just ask and learn. 3. Jobs Board — Updated Daily This took the longest to build. An autonomous scraper that: → Queries LinkedIn Guest API → Searches Naukri via AOL gateway → Finds Indeed listings → Sends each to Groq AI for analysis → Filters only junior/fresher roles → Checks freshness (last 4 days only) → Removes duplicates automatically → Inserts into PostgreSQL Result: 53+ curated jobs. Updated daily. Filter by: Python, Backend, AI, Frontend Filter by: 2025, 2026, 2027 graduates No more scrolling through senior roles pretending to be junior. 4. 220+ Prompt Vault Every prompt I've used to: Debug faster Write better code Prepare for interviews Build projects Copy. Use. Customize. 5. Improve Any Prompt (Free Tool) Paste any AI prompt. Get an optimized version instantly. No signup needed. The Tech Stack Built with: Python + Flask PostgreSQL (Neon) Groq API (Llama-3.3-70b) Render deployment SQLAlchemy + psycopg2 No React. No Next.js. No hype stack. Just Python and PostgreSQL doing real work. Why I Made It Free Because every resource that helped me was either: Paywalled after lesson 3 In English accent I had to rewind Using examples I couldn't relate to Assuming I had a MacBook and
AI 资讯
HLD Fundamentals #1: Network Protocols
Network Protocols Network protocols define how computers communicate over a network. Whether you're opening Instagram, sending a WhatsApp message, watching Netflix, or transferring money through a banking app, some protocol is working behind the scenes to make communication possible. Client-Server Model What is it? The Client-Server model is a communication architecture where: Client requests a service or data. Server processes the request and returns a response. Most modern applications follow this architecture. How Does It Work? Client ---------- Request ----------> Server Client <--------- Response ---------- Server The client always initiates communication, and the server listens for incoming requests. Real World Example Instagram When you open Instagram: Mobile app sends a request. Instagram servers process the request. Feed data is fetched from databases. Posts are returned to your phone. Instagram App | V Instagram Server | V Database Advantages Centralized control Easier security management Easy maintenance Easier data consistency Disadvantages Server can become a bottleneck Single point of failure if not replicated Interview One-Liner Client-Server architecture is a centralized model where clients request resources and servers provide them. Peer-to-Peer (P2P) Model What is it? In a Peer-to-Peer network, every machine can act as both: Client Server There is no central server controlling communication. How Does It Work? Peer A <------> Peer B ^ ^ | | V V Peer C <------> Peer D Each peer can directly share resources with others. Real World Example BitTorrent Instead of downloading a file from one server: User | +--> Peer 1 | +--> Peer 2 | +--> Peer 3 Different parts of the file are downloaded from multiple peers simultaneously. Blockchain Bitcoin and Ethereum networks operate using Peer-to-Peer communication. Advantages Highly scalable No central server cost Better fault tolerance Disadvantages Harder to manage Security challenges Data consistency issues Inter
创业投融资
Typescritp: Sobrecarga de Construtor
Introdução Assim como funções, construtores podem ter múltiplas assinaturas: O problema class Evento { constructor ( id : string , tipo : string , competencia : string ) { ... } // como aceitar também só id e tipo, sem competencia? } Solução — overload signatures class Evento { id : string ; tipo : string ; competencia : string ; // assinaturas constructor ( id : string , tipo : string ); constructor ( id : string , tipo : string , competencia : string ); // implementação constructor ( id : string , tipo : string , competencia : string = " nao-definida " ) { this . id = id ; this . tipo = tipo ; this . competencia = competencia ; } } new Evento ( " 1 " , " R-2010 " ); // ✅ primeira assinatura new Evento ( " 1 " , " R-2010 " , " 2024-01 " ); // ✅ segunda assinatura
AI 资讯
Teach Your Agent to Forget (On Purpose)
Hello, I'm Maneshwar. I'm building git-lrc, a Micro AI code reviewer that runs on every commit. It is...
AI 资讯
OS Architecture, Kernel, Shell & File System
🐧 Linux for DevOps — Session 2: Understanding the Kernel, Shell, OS Architecture & File System 📓 Learning in public — These are my personal notes from my Linux for DevOps & Cloud journey. I'm sharing them in a way that's easy to revisit later and hopefully useful for anyone else starting out. In the previous session, I got comfortable with Linux basics and terminal access. This session focused on understanding what actually happens behind the scenes when we run commands , how Linux is structured internally, and how files are organized on the system. These concepts might sound theoretical at first, but they're the foundation of everything you'll do in DevOps—from managing EC2 instances and Docker containers to troubleshooting production servers. The Linux Kernel: The Heart of the Operating System The kernel is the most important component of Linux. Think of it as a translator sitting between software and hardware. Applications can't directly talk to the CPU, RAM, disks, or network interfaces. Instead, every request goes through the kernel. When you run a command, open a browser, start a Docker container, or deploy an application, the kernel is responsible for making it happen. Its main responsibilities include: Responsibility Purpose Resource Management Decides which process gets CPU time Memory Management Allocates and releases RAM Process Management Creates, schedules, and terminates processes Device Management Communicates with hardware through drivers Without the kernel, Linux would simply be a collection of files with no way to interact with hardware. Types of Kernels Not every operating system uses the same kernel design. Monolithic Kernel (Linux) keeps most operating system services inside a single kernel space. This approach is extremely fast because components communicate directly. Microkernel keeps only essential functionality in kernel space and moves other services outside. This improves isolation and stability but introduces additional overhead. Hybrid K
AI 资讯
The First Message Sent Over the Internet Was 'LO'
The first message ever sent across the network that became the internet was not "Hello, world." It was not a grand declaration. It was two letters, transmitted by accident, before the system fell over: LO . That two-letter packet is the ancestor of every connected device, every IoT sensor, and every web request running today. The story of how it happened is also a surprisingly useful lesson for anyone building embedded systems and connected hardware right now. What actually happened on October 29, 1969 On the evening of October 29, 1969, a programmer named Charley Kline sat at a terminal in Leonard Kleinrock's lab at UCLA. His job was simple on paper: log in to a remote computer at the Stanford Research Institute (SRI), roughly 350 miles away, over a brand-new experimental network called ARPANET. The plan was to type the command LOGIN . The remote machine at SRI was set up to auto-complete the rest once it saw the first few characters, so Kline only needed to start typing. He had a colleague on the phone at the Stanford end to confirm each letter arrived. He typed L . Stanford confirmed: "Got the L." He typed O . Stanford confirmed: "Got the O." He typed G - and the SRI system crashed. So the first message ever transmitted over ARPANET was "LO." As Kleinrock later liked to point out, it was an accidental but fitting first word: "LO" as in "lo and behold." About an hour later they fixed the bug and completed the full login, but the historic first packet had already gone out, two letters at a time. Why a crash is the perfect origin story It is tempting to read this as a cute footnote. It is more than that. The very first thing the internet ever did was fail partway through a transaction - and the system was built well enough that the humans on both ends knew exactly how far it had gotten before it died. That is the entire discipline of networked systems in miniature. Connections drop. Remote machines crash mid-request. Packets arrive out of order, or not at all. The n
开发者
Indexes: Quickstart Using PostgreSQL (15 sec read)
Let's consider a table user . When we execute a query to find Emily , we are actually going through each record , looking whether the name column equals Emily . Indexes comes in when you want to speed this up. Let's create an Index with the name idx_users_name (the name can be anything, and it doesn't matter functionally): CREATE INDEX idx_users_name ON users ( name ); Now when you run SELECT * FROM users WHERE name = 'Emily' ; Postgres will use the index we just created (not by the name, the name is just for us) to execute that query, and the time complexity is reduced from O(n) to O(log n) .
AI 资讯
Deploying Symfony 8 to cPanel Step by Step guide.
Table of Contents Introduction Double-check everything Configure your Environment Variables Install/Update your Vendors Clear your Symfony Cache Install symfony/apache-pack Update composer.json public directory Build the assets Update Kernel.php Upload the project to cPanel Final Thoughts Introduction I'm new to Symfony and recently, I deployed a Symfony app to a shared hosting environment running cPanel with no SSH access. I could not figure out the best way to do it, let alone find useful resources online as most of them are outdated and felt inefficient. I faced a lot of errors like: failing to load the app with a 500 Internal Server Error, some static assets not loading, etc. I figured it out in the end. This motivated me to write this post to reduce the headache for other Symfony newbies like me. Alright, let's get into it. Most deployment guides online assume you can run Composer, clear caches, execute migrations, and run Symfony commands directly on the server. In shared hosting environments, that is often not possible so, my examples will assume you don't have it installed on the server. 1. Double-check everything The first step to building for production is double-checking everything if it's in intact. Yes, this is very important. In my case, I was faced with some static image assets failing to load because of wrong reference which was ignored on dev mode. I had something like: asset('/images/<filename> ) which was working in dev mode but failed to load the image in prod. the paths had to be like: asset('images/'). This was after checking how I defined other assets. So avoid things like this before hand. 2. Configure your Environment Variables For this, we will use the dotenv:dump command which is not registered by default, so you must register first in your services: # config/services.yaml services : Symfony\Component\Dotenv\Command\DotenvDumpCommand : ~ Then, run the command below. After running this command, Symfony will create and load the .env.local.ph
开发者
Looking to connect with fellow C++ learners and developers
Hi everyone 👋 I'm currently learning C++ and looking to connect with other people who enjoy programming. I'm interested in improving my coding skills, building small projects, and learning from more experienced developers. If you're also learning C++ or are willing to share advice with a beginner, I'd be happy to chat and learn together. Happy coding! 🚀
AI 资讯
I Thought Open Source Was About Code. I Was Wrong.
The biggest lessons I learned from open source contributions weren't found in the code itself. Communication, collaboration, and workflows matter more than I expected. For a long time, I hesitated to contribute to open source. Part of it was because I assumed that contributing meant writing code. As a self-taught developer, that felt intimidating. The other part was "Git anxiety." Forks, branches, pull requests, merge conflicts, and CI checks all seemed like a lot to understand before I could even make a contribution. Eventually, I started small. Instead of focusing on code, I looked for opportunities to improve documentation, README files, and learning materials. What surprised me was that writing the actual change was often the easy part. Most of my learning happened outside the code itself: understanding contribution guidelines, repository workflows, automation, and review expectations. Over time, I realized that modern open source contribution is about much more than just writing code. Contribution Model Has Changed When many people think about open source contributions, the mental model is still fairly simple: Find Bug ↓ Write Code ↓ Open PR In reality, I realized that most modern repos involve much more than that. Before making a change, contributors often need to understand project workflows, CI pipelines, automated checks, contribution guidelines, and review expectations. The code change itself might only take a few minutes, while understanding how the repo operates can take much longer. A modern contribution often looks more like this: Understand Repository ↓ Understand Workflow ↓ Understand Automation ↓ Make Change ↓ Open PR ↓ Respond to Review It looks intimidating, but I think this flow helps projects stay maintainable as communications grow. What I've learned from contributing to different projects is that open source is not just a coding skill. It's also a collaboration skill. The faster you can understand how a project works, the easier it becomes to
开发者
C# 14: The `field` Keyword — Cleaner Properties, Zero Boilerplate
C# 14: The field Keyword — Cleaner Properties, Zero Boilerplate Every C# developer has been there. You start with a clean auto-property, then requirements change and you need to add a tiny bit of validation. Suddenly that one-liner explodes into six lines of boilerplate — a private backing field, a getter that just returns it, a setter that assigns it. The logic is two words. The ceremony is everything else. C# 14 fixes this with the field keyword: a contextual keyword that refers to the compiler-synthesized backing field of a property, letting you write custom accessor logic without ever declaring an explicit field. The Problem: Boilerplate Tax on Simple Properties Auto-properties are one of C#'s best quality-of-life features. This is clean: public string Username { get ; set ; } But the moment you need to trim whitespace on assignment, that cleanness evaporates: private string _username = string . Empty ; public string Username { get => _username ; set => _username = value . Trim (); } You now have six lines — and four of them exist only to hold the shape of the pattern together. The backing field _username is not carrying any meaningful design weight. Its only job is to be a storage slot that Username uses privately. You already know the compiler creates one for auto-properties. You are just forced to make it visible so you can reference it. This is the boilerplate tax. You pay it every time you add even the smallest piece of logic to a property. Why field Exists The C# language team has discussed this friction for years. The challenge was finding syntax that is: Unambiguous — no conflict with existing identifiers Familiar — consistent with how value works in setters Scoped — only meaningful inside a property accessor The solution landed in C# 14: the contextual keyword field . Just like value refers to the incoming assignment in a setter, field refers to the hidden backing storage the compiler manages for the property. It is contextual, which means it only acts
AI 资讯
🔥 The Sales Call Is Not a Performance — It's a Diagnosis
I have watched founders lose sales calls they should have won. Not because they lacked skill. Not because the offer was wrong. Because they walked in to prove they were smart — instead of finding out whether the pain was real. Sales Is Diagnosis Plus Decision The call is not there for you to pitch. The call is there to find out: Is the pain real? Does the buyer have urgency? Does the budget exist? Can a fixed-scope sprint create a clear win? That is it. Four questions. Everything else follows from those. Sales is not pressure. Sales is diagnosis plus decision. 1️⃣ The Call Structure That Works Frame the call in the first 60 seconds: "I'll understand the current state, ask what is costing you, then tell you whether a sprint makes sense. If it doesn't, I'll say so." That sentence does 3 things: Sets expectations — no pressure, no hard close Signals competence — you have done this before Removes the buyer's guard — they can be honest about what is broken Then run this flow: 1️⃣ Current state — what exists now? 2️⃣ Pain — what is broken or slow? 3️⃣ Cost — what does it cost in time, money, trust, or delay? 4️⃣ Urgency — why now? 5️⃣ Decision — who approves? 6️⃣ Success — what would make this worth paying for? 7️⃣ Close — recommend the sprint or walk away 2️⃣ The Questions That Reveal Money These are the 6 questions I use to find whether a sprint is worth recommending: "What happens if this stays broken for another 30 days?" — reveals urgency and cost "What have you already tried?" — reveals how serious they are "Where does the current process lose leads, users, time, or trust?" — reveals the money leak "Who feels this pain most inside the business?" — reveals whether the buyer is also the decision-maker "What would make this an obvious win?" — reveals success criteria before you price "If we fixed only one thing first, what would matter most?" — reveals scope Listen for the answer with the money in it. That is the thing you fix. That is what you price. That is the sprin
产品设计
Building a Liquidity Monitoring Engine for a Polymarket Trading bot: Architecture, Strategy, and Real-Time Market Intelligence
In every successful Polymarket Trading bot, liquidity monitoring is one of the most overlooked yet...
AI 资讯
Stop Whispering to the Model, Start Furnishing Its Brain
Hello, I'm Maneshwar. I'm building git-lrc, a Micro AI code reviewer that runs on every commit. It is...
开发者
Implementing Protected Routes and Authentication in React (2026 Edition)
This is an updated rewrite of my 2021 article on protected routes . A lot has changed in the React ecosystem since then. React Router moved from v5 to v7, class components have faded out, and the patterns we use for authentication state have matured. This version reflects how protected routes are built in modern React applications. Almost every web application requires some form of authentication to prevent unauthorized users from accessing parts of the application meant for signed-in users only. In this tutorial, I'll show how to set up an authentication flow and protect routes from unauthorized access using modern React patterns: function components, hooks, React Router v6+, and the Context API. First things first Install the dependency: npm i react-router-dom That's it. React Router v6 and above ships as a single package, so you no longer need to install react-router and react-router-dom separately. It is worthy of note that we will not be using Redux for authentication state in this version. For something as simple as "is the user logged in?", React's built-in Context API is the standard approach today. Redux still has its place, but it is overkill here. The Auth Context Instead of writing to localStorage directly from components and reading it in random places, we centralize authentication state in a context. This gives us a single source of truth and a clean useAuth() hook we can call anywhere in the app. Create ./src/auth/AuthContext.jsx : import { createContext , useContext , useState } from " react " ; const AuthContext = createContext ( null ); export function AuthProvider ({ children }) { const [ user , setUser ] = useState (() => { // Rehydrate on page refresh const saved = localStorage . getItem ( " user " ); return saved ? JSON . parse ( saved ) : null ; }); const login = async ( username , password ) => { // In a real app, this is an API call to your backend. // We simulate it here with hardcoded credentials. if ( username . toLowerCase () === " admin
AI 资讯
Virtualization in Cloud Computing: Definition, Types, and Practical Guide
If you've ever spun up an EC2 instance for a side project, accessed a remote work desktop from your personal laptop, or stored files on Google Drive without thinking about the physical hard drive it lives on, you've used virtualization. As the foundational technology behind all modern cloud computing, virtualization transformed how we build, deploy, and manage IT infrastructure—cutting hardware costs significantly for enterprises and making on-demand scalability a reality for teams of all sizes. In this guide, we'll break down exactly what virtualization is, how it powers the cloud, the 6 core types of virtualization, and best practices to implement it safely and efficiently. Table of Contents What is Virtualization in Cloud Computing? Core Virtualization Concepts You Need to Know Role of Virtualization in Cloud Computing 6 Key Types of Virtualization (With Use Cases) Top Benefits of Virtualization for Teams of All Sizes Virtualization vs. Related Technologies Virtualization vs. Cloud Computing Virtualization vs. Containerization Common Virtualization Challenges and Mitigations Real-World Virtualization Use Cases Virtualization Best Practices Conclusion References What is Virtualization in Cloud Computing? Virtualization is a technology that creates virtual, software-based representations of physical hardware (servers, storage, networks, etc.) and abstracts these resources from the underlying physical machine. A software layer called a hypervisor separates operating systems and applications from physical hardware, allowing multiple isolated, self-contained systems called Virtual Machines (VMs) to run simultaneously on a single physical host. Each VM has its own virtual CPU, memory, storage, and network interface, and operates independently of other VMs on the same host. For cloud providers, this technology is the backbone of all on-demand infrastructure services, allowing them to share physical hardware across thousands of customers securely and efficiently. Core Vi
开发者
Local Time, UTC, Offset και Epoch: Ο απόλυτος οδηγός για developers
Το πρόβλημα της ώρας Η ώρα είναι από τα πιο ύπουλα προβλήματα στην ανάπτυξη λογισμικού. Αν ένας χρήστης στην Αθήνα δημιουργήσει μια παραγγελία στις 20:00 και ένας άλλος στη Νέα Υόρκη τη δει στις 13:00, ποια είναι η "σωστή" ώρα; Αν μια εφαρμογή αποθηκεύσει μόνο το 20:00, χωρίς να γνωρίζει τη ζώνη ώρας, τότε η πληροφορία είναι πρακτικά άχρηστη. Αυτός είναι ο λόγος που υπάρχουν έννοιες όπως: Local Time UTC UTC Offset Epoch / Unix Timestamp Δεν δημιουργήθηκαν για να μας μπερδεύουν. Δημιουργήθηκαν για να λύνουν το πρόβλημα της παγκόσμιας διαχείρισης χρόνου. Local Time Το Local Time είναι η ώρα που βλέπει ο χρήστης στη χώρα του. Παραδείγματα: Αθήνα: 2026-06-09 20:00 Λονδίνο: 2026-06-09 18:00 Νέα Υόρκη:2026-06-09 13:00 Όλες οι παραπάνω ώρες μπορεί να αντιστοιχούν στην ίδια ακριβώς χρονική στιγμή. Συνέβει ένα γεγονός μία ενέργεια στον πλανίτη γη ακριβώς αυτή την στιγμή που όμως για διαφορετικές γεωγραφικές περιοχές αντιστοιχεί σε διαφορετικές ώρες. Πότε χρησιμοποιούμε Local Time; Μόνο για εμφάνιση στον χρήστη. Παραδείγματα: Ημερομηνία παραγγελίας Ώρα δημιουργίας post Ημερολόγιο συναντήσεων Reports προς τον χρήστη Πότε ΔΕΝ το αποθηκεύουμε; Σχεδόν ποτέ ως μοναδική πηγή αλήθειας. Αν αποθηκεύσεις: 2026-06-09 20:00 δεν γνωρίζεις: Σε ποια χώρα δημιουργήθηκε Σε ποια ζώνη ώρας ανήκει Αν ίσχυε θερινή ώρα (DST) UTC (Coordinated Universal Time) Το UTC είναι η παγκόσμια αναφορά χρόνου. Όλες οι ζώνες ώρας υπολογίζονται σε σχέση με αυτό. Παράδειγμα: UTC: 2026-06-09 17:00 Την ίδια στιγμή με βάση την UTC ώρα μπορούμε να έχουμε: στην Αθήνα UTC+3 -> 20:00 στο Λονδίνο UTC+1 -> 18:00 στη Νέα Υόρκη UTC-4 -> 13:00 Πότε χρησιμοποιούμε UTC; Σχεδόν πάντα στο backend. Αποθηκεύουμε: 2026-06-09 T 17 : 00 : 00 Z Το Z σημαίνει UTC. Γιατί; Επειδή: Δεν αλλάζει με DST Δεν εξαρτάται από χώρα Είναι παγκόσμιο σημείο αναφοράς Ένας κανόνας που ακολουθούν σχεδόν όλες οι μεγάλες εταιρείες: Store in UTC, display in Local Time. UTC Offset Παραδείγματα: UTC+3 UTC+2 UTC-5 UTC+9 Για την Αθήνα: Χειμώνας -> UTC+2 Καλοκα