diff --git a/20240311/WindowsFormsApp1/.vs/WindowsFormsApp1/v16/.suo b/20240311/WindowsFormsApp1/.vs/WindowsFormsApp1/v16/.suo new file mode 100644 index 0000000..0e472ba Binary files /dev/null and b/20240311/WindowsFormsApp1/.vs/WindowsFormsApp1/v16/.suo differ diff --git a/20240311/WindowsFormsApp1/App.config b/20240311/WindowsFormsApp1/App.config new file mode 100644 index 0000000..56efbc7 --- /dev/null +++ b/20240311/WindowsFormsApp1/App.config @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/20240311/WindowsFormsApp1/Form1.Designer.cs b/20240311/WindowsFormsApp1/Form1.Designer.cs new file mode 100644 index 0000000..f036b5e --- /dev/null +++ b/20240311/WindowsFormsApp1/Form1.Designer.cs @@ -0,0 +1,109 @@ + +namespace WindowsFormsApp1 +{ + partial class Form1 + { + /// + /// Required designer variable. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Clean up any resources being used. + /// + /// true if managed resources should be disposed; otherwise, false. + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Windows Form Designer generated code + + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + this.components = new System.ComponentModel.Container(); + this.button1 = new System.Windows.Forms.Button(); + this.button2 = new System.Windows.Forms.Button(); + this.label1 = new System.Windows.Forms.Label(); + this.timer1 = new System.Windows.Forms.Timer(this.components); + this.textBox1 = new System.Windows.Forms.TextBox(); + this.SuspendLayout(); + // + // button1 + // + this.button1.Location = new System.Drawing.Point(197, 262); + this.button1.Name = "button1"; + this.button1.Size = new System.Drawing.Size(75, 23); + this.button1.TabIndex = 0; + this.button1.Text = "Start"; + this.button1.UseVisualStyleBackColor = true; + this.button1.Click += new System.EventHandler(this.button1_Click); + // + // button2 + // + this.button2.Location = new System.Drawing.Point(421, 261); + this.button2.Name = "button2"; + this.button2.Size = new System.Drawing.Size(75, 23); + this.button2.TabIndex = 1; + this.button2.Text = "Stop"; + this.button2.UseVisualStyleBackColor = true; + this.button2.Click += new System.EventHandler(this.button2_Click); + // + // label1 + // + this.label1.AutoSize = true; + this.label1.Location = new System.Drawing.Point(297, 191); + this.label1.Name = "label1"; + this.label1.Size = new System.Drawing.Size(0, 13); + this.label1.TabIndex = 2; + this.label1.Click += new System.EventHandler(this.label1_Click); + // + // timer1 + // + this.timer1.Enabled = true; + this.timer1.Interval = 1000; + this.timer1.Tick += new System.EventHandler(this.textBox1_TextChanged); + // + // textBox1 + // + this.textBox1.Location = new System.Drawing.Point(395, 184); + this.textBox1.Name = "textBox1"; + this.textBox1.Size = new System.Drawing.Size(100, 20); + this.textBox1.TabIndex = 3; + this.textBox1.TextChanged += new System.EventHandler(this.textBox1_TextChanged); + // + // Form1 + // + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.ClientSize = new System.Drawing.Size(800, 450); + this.Controls.Add(this.textBox1); + this.Controls.Add(this.label1); + this.Controls.Add(this.button2); + this.Controls.Add(this.button1); + this.Name = "Form1"; + this.Text = "Form1"; + this.Load += new System.EventHandler(this.Form1_Load); + this.ResumeLayout(false); + this.PerformLayout(); + + } + + #endregion + + private System.Windows.Forms.Button button1; + private System.Windows.Forms.Button button2; + private System.Windows.Forms.Label label1; + private System.Windows.Forms.Timer timer1; + private System.Windows.Forms.TextBox textBox1; + } +} + diff --git a/20240311/WindowsFormsApp1/Form1.cs b/20240311/WindowsFormsApp1/Form1.cs new file mode 100644 index 0000000..bda7782 --- /dev/null +++ b/20240311/WindowsFormsApp1/Form1.cs @@ -0,0 +1,55 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Data; +using System.Drawing; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows.Forms; + +namespace WindowsFormsApp1 +{ + public partial class Form1 : Form + { + DateTime start = new DateTime(); + DateTime stop = new DateTime(); + TimeSpan duration = new TimeSpan(); + public Form1() + { + InitializeComponent(); + } + + private void Form1_Load(object sender, EventArgs e) + { + + } + + private void button1_Click(object sender, EventArgs e) + { + start = DateTime.Now; + timer1.Enabled = true; + button1.Enabled = false; + } + + private void button2_Click(object sender, EventArgs e) + { + stop = DateTime.Now; + duration = stop - start; + label1.Text = duration.ToString(); + + timer1.Enabled = false; + button1.Enabled = true; + } + + private void label1_Click(object sender, EventArgs e) + { + + } + + private void textBox1_TextChanged(object sender, EventArgs e) + { + textBox1.Text = DateTime.Now.ToString("HH:mm:ss:fff"); + } + } +} diff --git a/20240311/WindowsFormsApp1/Form1.resx b/20240311/WindowsFormsApp1/Form1.resx new file mode 100644 index 0000000..1f666f2 --- /dev/null +++ b/20240311/WindowsFormsApp1/Form1.resx @@ -0,0 +1,123 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + 17, 17 + + \ No newline at end of file diff --git a/20240311/WindowsFormsApp1/Program.cs b/20240311/WindowsFormsApp1/Program.cs new file mode 100644 index 0000000..30a0128 --- /dev/null +++ b/20240311/WindowsFormsApp1/Program.cs @@ -0,0 +1,22 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; +using System.Windows.Forms; + +namespace WindowsFormsApp1 +{ + static class Program + { + /// + /// The main entry point for the application. + /// + [STAThread] + static void Main() + { + Application.EnableVisualStyles(); + Application.SetCompatibleTextRenderingDefault(false); + Application.Run(new Form1()); + } + } +} diff --git a/20240311/WindowsFormsApp1/Properties/AssemblyInfo.cs b/20240311/WindowsFormsApp1/Properties/AssemblyInfo.cs new file mode 100644 index 0000000..d1c77e5 --- /dev/null +++ b/20240311/WindowsFormsApp1/Properties/AssemblyInfo.cs @@ -0,0 +1,36 @@ +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +[assembly: AssemblyTitle("WindowsFormsApp1")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("WindowsFormsApp1")] +[assembly: AssemblyCopyright("Copyright © 2024")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[assembly: ComVisible(false)] + +// The following GUID is for the ID of the typelib if this project is exposed to COM +[assembly: Guid("4bc7b91b-d0c1-4153-a83e-420a89594faa")] + +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// You can specify all the values or you can default the Build and Revision Numbers +// by using the '*' as shown below: +// [assembly: AssemblyVersion("1.0.*")] +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/20240311/WindowsFormsApp1/Properties/Resources.Designer.cs b/20240311/WindowsFormsApp1/Properties/Resources.Designer.cs new file mode 100644 index 0000000..2b9cd9f --- /dev/null +++ b/20240311/WindowsFormsApp1/Properties/Resources.Designer.cs @@ -0,0 +1,70 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Runtime Version:4.0.30319.42000 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + + +namespace WindowsFormsApp1.Properties +{ + /// + /// A strongly-typed resource class, for looking up localized strings, etc. + /// + // This class was auto-generated by the StronglyTypedResourceBuilder + // class via a tool like ResGen or Visual Studio. + // To add or remove a member, edit your .ResX file then rerun ResGen + // with the /str option, or rebuild your VS project. + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + internal class Resources + { + + private static global::System.Resources.ResourceManager resourceMan; + + private static global::System.Globalization.CultureInfo resourceCulture; + + [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] + internal Resources() + { + } + + /// + /// Returns the cached ResourceManager instance used by this class. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Resources.ResourceManager ResourceManager + { + get + { + if ((resourceMan == null)) + { + global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("WindowsFormsApp1.Properties.Resources", typeof(Resources).Assembly); + resourceMan = temp; + } + return resourceMan; + } + } + + /// + /// Overrides the current thread's CurrentUICulture property for all + /// resource lookups using this strongly typed resource class. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Globalization.CultureInfo Culture + { + get + { + return resourceCulture; + } + set + { + resourceCulture = value; + } + } + } +} diff --git a/20240311/WindowsFormsApp1/Properties/Resources.resx b/20240311/WindowsFormsApp1/Properties/Resources.resx new file mode 100644 index 0000000..af7dbeb --- /dev/null +++ b/20240311/WindowsFormsApp1/Properties/Resources.resx @@ -0,0 +1,117 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/20240311/WindowsFormsApp1/Properties/Settings.Designer.cs b/20240311/WindowsFormsApp1/Properties/Settings.Designer.cs new file mode 100644 index 0000000..3cdaf80 --- /dev/null +++ b/20240311/WindowsFormsApp1/Properties/Settings.Designer.cs @@ -0,0 +1,29 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Runtime Version:4.0.30319.42000 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + + +namespace WindowsFormsApp1.Properties +{ + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "11.0.0.0")] + internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase + { + + private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); + + public static Settings Default + { + get + { + return defaultInstance; + } + } + } +} diff --git a/20240311/WindowsFormsApp1/Properties/Settings.settings b/20240311/WindowsFormsApp1/Properties/Settings.settings new file mode 100644 index 0000000..3964565 --- /dev/null +++ b/20240311/WindowsFormsApp1/Properties/Settings.settings @@ -0,0 +1,7 @@ + + + + + + + diff --git a/20240311/WindowsFormsApp1/WindowsFormsApp1.csproj b/20240311/WindowsFormsApp1/WindowsFormsApp1.csproj new file mode 100644 index 0000000..0d9df30 --- /dev/null +++ b/20240311/WindowsFormsApp1/WindowsFormsApp1.csproj @@ -0,0 +1,83 @@ + + + + + Debug + AnyCPU + {4BC7B91B-D0C1-4153-A83E-420A89594FAA} + WinExe + WindowsFormsApp1 + WindowsFormsApp1 + v4.7.2 + 512 + true + true + + + AnyCPU + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + AnyCPU + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + + + + + + + + + + + + + + + Form + + + Form1.cs + + + + + Form1.cs + + + ResXFileCodeGenerator + Resources.Designer.cs + Designer + + + True + Resources.resx + + + SettingsSingleFileGenerator + Settings.Designer.cs + + + True + Settings.settings + True + + + + + + + \ No newline at end of file diff --git a/20240311/WindowsFormsApp1/WindowsFormsApp1.sln b/20240311/WindowsFormsApp1/WindowsFormsApp1.sln new file mode 100644 index 0000000..aecb04c --- /dev/null +++ b/20240311/WindowsFormsApp1/WindowsFormsApp1.sln @@ -0,0 +1,25 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 16 +VisualStudioVersion = 16.0.33529.622 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WindowsFormsApp1", "WindowsFormsApp1.csproj", "{4BC7B91B-D0C1-4153-A83E-420A89594FAA}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {4BC7B91B-D0C1-4153-A83E-420A89594FAA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {4BC7B91B-D0C1-4153-A83E-420A89594FAA}.Debug|Any CPU.Build.0 = Debug|Any CPU + {4BC7B91B-D0C1-4153-A83E-420A89594FAA}.Release|Any CPU.ActiveCfg = Release|Any CPU + {4BC7B91B-D0C1-4153-A83E-420A89594FAA}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {EED7E804-1EE1-48A7-B870-3787FCA9667D} + EndGlobalSection +EndGlobal diff --git a/20240311/WindowsFormsApp1/bin/Debug/WindowsFormsApp1.exe b/20240311/WindowsFormsApp1/bin/Debug/WindowsFormsApp1.exe new file mode 100644 index 0000000..bc7f814 Binary files /dev/null and b/20240311/WindowsFormsApp1/bin/Debug/WindowsFormsApp1.exe differ diff --git a/20240311/WindowsFormsApp1/bin/Debug/WindowsFormsApp1.exe.config b/20240311/WindowsFormsApp1/bin/Debug/WindowsFormsApp1.exe.config new file mode 100644 index 0000000..56efbc7 --- /dev/null +++ b/20240311/WindowsFormsApp1/bin/Debug/WindowsFormsApp1.exe.config @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/20240311/WindowsFormsApp1/bin/Debug/WindowsFormsApp1.pdb b/20240311/WindowsFormsApp1/bin/Debug/WindowsFormsApp1.pdb new file mode 100644 index 0000000..c2198a3 Binary files /dev/null and b/20240311/WindowsFormsApp1/bin/Debug/WindowsFormsApp1.pdb differ diff --git a/20240311/WindowsFormsApp1/obj/Debug/.NETFramework,Version=v4.7.2.AssemblyAttributes.cs b/20240311/WindowsFormsApp1/obj/Debug/.NETFramework,Version=v4.7.2.AssemblyAttributes.cs new file mode 100644 index 0000000..3871b18 --- /dev/null +++ b/20240311/WindowsFormsApp1/obj/Debug/.NETFramework,Version=v4.7.2.AssemblyAttributes.cs @@ -0,0 +1,4 @@ +// +using System; +using System.Reflection; +[assembly: global::System.Runtime.Versioning.TargetFrameworkAttribute(".NETFramework,Version=v4.7.2", FrameworkDisplayName = ".NET Framework 4.7.2")] diff --git a/20240311/WindowsFormsApp1/obj/Debug/DesignTimeResolveAssemblyReferences.cache b/20240311/WindowsFormsApp1/obj/Debug/DesignTimeResolveAssemblyReferences.cache new file mode 100644 index 0000000..a6920de Binary files /dev/null and b/20240311/WindowsFormsApp1/obj/Debug/DesignTimeResolveAssemblyReferences.cache differ diff --git a/20240311/WindowsFormsApp1/obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache b/20240311/WindowsFormsApp1/obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache new file mode 100644 index 0000000..3661937 Binary files /dev/null and b/20240311/WindowsFormsApp1/obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache differ diff --git a/20240311/WindowsFormsApp1/obj/Debug/WindowsFormsApp1.Form1.resources b/20240311/WindowsFormsApp1/obj/Debug/WindowsFormsApp1.Form1.resources new file mode 100644 index 0000000..6c05a97 Binary files /dev/null and b/20240311/WindowsFormsApp1/obj/Debug/WindowsFormsApp1.Form1.resources differ diff --git a/20240311/WindowsFormsApp1/obj/Debug/WindowsFormsApp1.Properties.Resources.resources b/20240311/WindowsFormsApp1/obj/Debug/WindowsFormsApp1.Properties.Resources.resources new file mode 100644 index 0000000..6c05a97 Binary files /dev/null and b/20240311/WindowsFormsApp1/obj/Debug/WindowsFormsApp1.Properties.Resources.resources differ diff --git a/20240311/WindowsFormsApp1/obj/Debug/WindowsFormsApp1.csproj.AssemblyReference.cache b/20240311/WindowsFormsApp1/obj/Debug/WindowsFormsApp1.csproj.AssemblyReference.cache new file mode 100644 index 0000000..f5e894a Binary files /dev/null and b/20240311/WindowsFormsApp1/obj/Debug/WindowsFormsApp1.csproj.AssemblyReference.cache differ diff --git a/20240311/WindowsFormsApp1/obj/Debug/WindowsFormsApp1.csproj.CoreCompileInputs.cache b/20240311/WindowsFormsApp1/obj/Debug/WindowsFormsApp1.csproj.CoreCompileInputs.cache new file mode 100644 index 0000000..4a5524a --- /dev/null +++ b/20240311/WindowsFormsApp1/obj/Debug/WindowsFormsApp1.csproj.CoreCompileInputs.cache @@ -0,0 +1 @@ +8069502011d0681850e57a53d5a1673222f430a6 diff --git a/20240311/WindowsFormsApp1/obj/Debug/WindowsFormsApp1.csproj.FileListAbsolute.txt b/20240311/WindowsFormsApp1/obj/Debug/WindowsFormsApp1.csproj.FileListAbsolute.txt new file mode 100644 index 0000000..0b2ae14 --- /dev/null +++ b/20240311/WindowsFormsApp1/obj/Debug/WindowsFormsApp1.csproj.FileListAbsolute.txt @@ -0,0 +1,10 @@ +C:\Users\szabomarton\Desktop\C#\20240311\WindowsFormsApp1\bin\Debug\WindowsFormsApp1.exe.config +C:\Users\szabomarton\Desktop\C#\20240311\WindowsFormsApp1\bin\Debug\WindowsFormsApp1.exe +C:\Users\szabomarton\Desktop\C#\20240311\WindowsFormsApp1\bin\Debug\WindowsFormsApp1.pdb +C:\Users\szabomarton\Desktop\C#\20240311\WindowsFormsApp1\obj\Debug\WindowsFormsApp1.csproj.AssemblyReference.cache +C:\Users\szabomarton\Desktop\C#\20240311\WindowsFormsApp1\obj\Debug\WindowsFormsApp1.Form1.resources +C:\Users\szabomarton\Desktop\C#\20240311\WindowsFormsApp1\obj\Debug\WindowsFormsApp1.Properties.Resources.resources +C:\Users\szabomarton\Desktop\C#\20240311\WindowsFormsApp1\obj\Debug\WindowsFormsApp1.csproj.GenerateResource.cache +C:\Users\szabomarton\Desktop\C#\20240311\WindowsFormsApp1\obj\Debug\WindowsFormsApp1.csproj.CoreCompileInputs.cache +C:\Users\szabomarton\Desktop\C#\20240311\WindowsFormsApp1\obj\Debug\WindowsFormsApp1.exe +C:\Users\szabomarton\Desktop\C#\20240311\WindowsFormsApp1\obj\Debug\WindowsFormsApp1.pdb diff --git a/20240311/WindowsFormsApp1/obj/Debug/WindowsFormsApp1.csproj.GenerateResource.cache b/20240311/WindowsFormsApp1/obj/Debug/WindowsFormsApp1.csproj.GenerateResource.cache new file mode 100644 index 0000000..f2a27de Binary files /dev/null and b/20240311/WindowsFormsApp1/obj/Debug/WindowsFormsApp1.csproj.GenerateResource.cache differ diff --git a/20240311/WindowsFormsApp1/obj/Debug/WindowsFormsApp1.exe b/20240311/WindowsFormsApp1/obj/Debug/WindowsFormsApp1.exe new file mode 100644 index 0000000..bc7f814 Binary files /dev/null and b/20240311/WindowsFormsApp1/obj/Debug/WindowsFormsApp1.exe differ diff --git a/20240311/WindowsFormsApp1/obj/Debug/WindowsFormsApp1.pdb b/20240311/WindowsFormsApp1/obj/Debug/WindowsFormsApp1.pdb new file mode 100644 index 0000000..c2198a3 Binary files /dev/null and b/20240311/WindowsFormsApp1/obj/Debug/WindowsFormsApp1.pdb differ diff --git a/form_anyag b/form_anyag index 0b38ded..909a116 100644 --- a/form_anyag +++ b/form_anyag @@ -161,3 +161,80 @@ Text van Nincs BorderStyle nincs, szegély van van default:none AutoScroll Nincs Van + + +Dátum idő és időzítő + +A dátum és az idő tárolására a C# nyelv a külön típusokat hozott létre. +Ezekkel az idő egy adott opntját vagy egy időszeletet tudjukk ábrázolni illetve kezelni. +Ezenfelül van egy időzítőnk is.amivel pedig adott időközönként tetsuőleges eseménykezelőt tudunk lefuttatni. + +Dátum és idő tárolása + DateTime usersDatumIdo = new DateTime(); + + DateTime csakDatum = new DateTime(2024,3,11); + DateTime mindketto = new DateTime(2024, 3, 11, 9, 55, 11); + + TimeSpan eltelDatumido = new TimeSpan(1, 59, 59); + +Időkölünbözet számításra is alkalmas + DateTime d1 = new DateTime(2024, 12, 24); + DateTime now = DateTime.Now; + TimeSpan dist = d1 - now; + +Dátum és idő megjelenítése: +év y +hónap M +nap d +óra h H +perc m +másodperc s +ezredmásodperc f + +formátumkód leírás megjelenés +yy év két számjeggyel 24 (2024 helyett) +yyyy 2024 +M hónap sorszáma 1-12 +MM 01-12 +MMM hónap rövidítve jan-dec +MMMM teljes név január-december +d nap sorszáma 1-31 +dd 01-31 +ddd nap rövidítve hét-vas +dddd teljes név +h óra egy számjeggyel 1-12 +H 0-23 +hh HH 01-12 00-23 +m 0-59 +mm 00-59 +s 0-59 +ss 00-59 +fff 000-999 + + DateTime d1 = new DateTime(2024, 3, 11, 10, 45, 10, 12); + label1.Text = d1.ToString("yy/M/d"); + // 24.3.11 + label1.Text = d1.ToString("yyyy MMM d dddd"); + // 2024.mar.11.Hétfő + +Rövidített jelölések +jel megjelenés +d 2024.12.24 +D 2024.december 24. +f 2024.december 24. 16:02 +g 2024.12.24. 16:02 +t 16:02 +T 16:02:15 + +DateTime now = DateTime.Now; +int honap = now.Month; +int nap = now.Day; +int ev = now.Year; +int masodperc = now.Second; + +DayOfWeek DayOfYear + int hetnapja = int.Parse( now.DayOfWeek.ToString()); + int evnapja = int.Parse(now.DayOfYear.ToString()); + + +